aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/core.js
diff options
context:
space:
mode:
authorOleg Gaidarenko <markelog@gmail.com>2015-09-08 03:26:29 +0300
committerOleg Gaidarenko <markelog@gmail.com>2015-09-08 04:15:54 +0300
commit2f0cedc9972efa4bf9eb656001a098d9c51e53ec (patch)
tree33d44ac9d4a8ea0e441663c6f070593f615ce2b1 /test/unit/core.js
parentf71e32d4b46f3be293304d40ed6dc85cf30d6a7b (diff)
downloadjquery-2f0cedc9972efa4bf9eb656001a098d9c51e53ec.tar.gz
jquery-2f0cedc9972efa4bf9eb656001a098d9c51e53ec.zip
Tests: further improvements QUnit 2.0 migration
* Remove QUnit jshint globals * Extend QUnit.assert methods * Use assert.async instead of start/stop/done Ref b930d14ce64937e9478405eee2828d4da091d2cb Ref c8d15a2f9f108e90d3651c31e4abf45415a30fde
Diffstat (limited to 'test/unit/core.js')
-rw-r--r--test/unit/core.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/test/unit/core.js b/test/unit/core.js
index 805ae4eaa..de0fc0bcd 100644
--- a/test/unit/core.js
+++ b/test/unit/core.js
@@ -30,7 +30,7 @@ QUnit.test( "jQuery()", function( assert ) {
// few here but beware of modular builds where these methods may be excluded.
if ( jQuery.fn.click ) {
expected++;
- attrObj[ "click" ] = function() { ok( exec, "Click executed." ); };
+ attrObj[ "click" ] = function() { assert.ok( exec, "Click executed." ); };
}
if ( jQuery.fn.width ) {
expected++;
@@ -1285,7 +1285,9 @@ QUnit.test( "jQuery.proxy", function( assert ) {
assert.expect( 9 );
var test2, test3, test4, fn, cb,
- test = function() { equal( this, thisObject, "Make sure that scope is set properly." ); },
+ test = function() {
+ assert.equal( this, thisObject, "Make sure that scope is set properly." );
+ },
thisObject = { foo: "bar", method: test };
// Make sure normal works
@@ -1301,15 +1303,21 @@ QUnit.test( "jQuery.proxy", function( assert ) {
assert.equal( jQuery.proxy( null, thisObject ), undefined, "Make sure no function was returned." );
// Partial application
- test2 = function( a ) { equal( a, "pre-applied", "Ensure arguments can be pre-applied." ); };
+ test2 = function( a ) {
+ assert.equal( a, "pre-applied", "Ensure arguments can be pre-applied." );
+ };
jQuery.proxy( test2, null, "pre-applied" )();
// Partial application w/ normal arguments
- test3 = function( a, b ) { equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." ); };
+ test3 = function( a, b ) {
+ assert.equal( b, "normal", "Ensure arguments can be pre-applied and passed as usual." );
+ };
jQuery.proxy( test3, null, "pre-applied" )( "normal" );
// Test old syntax
- test4 = { "meth": function( a ) { equal( a, "boom", "Ensure old syntax works." ); } };
+ test4 = { "meth": function( a ) {
+ assert.equal( a, "boom", "Ensure old syntax works." );
+ } };
jQuery.proxy( test4, "meth" )( "boom" );
// jQuery 1.9 improved currying with `this` object
@@ -1365,7 +1373,7 @@ QUnit.test( "jQuery.parseHTML", function( assert ) {
if ( jQuery.support.createHTMLDocument ) {
QUnit.asyncTest( "jQuery.parseHTML", function( assert ) {
- expect ( 1 );
+ assert.expect ( 1 );
Globals.register( "parseHTMLError" );