aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/basic.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-03-02 22:15:06 +0100
committerMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-03-02 22:18:10 +0100
commit5ea844f65a820ebba7ae7c82af7bfab58f873e5a (patch)
tree3b18d0c8755d4848713097979f64ef9880e48482 /test/unit/basic.js
parent362075aeaa269f27ba2c2832026f211c2767d010 (diff)
downloadjquery-5ea844f65a820ebba7ae7c82af7bfab58f873e5a.tar.gz
jquery-5ea844f65a820ebba7ae7c82af7bfab58f873e5a.zip
Tests: Pass a number of necessary done() calls to assert.async()
It is no longer needed to create `done` wrappers in tests that require multiple async operations to complete. Closes gh-4633 (cherry picked from commit 364476c3dc1231603ba61fc08068fa89fb095e1a)
Diffstat (limited to 'test/unit/basic.js')
-rw-r--r--test/unit/basic.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/unit/basic.js b/test/unit/basic.js
index c42ee5450..9cb7d25be 100644
--- a/test/unit/basic.js
+++ b/test/unit/basic.js
@@ -4,14 +4,14 @@ if ( jQuery.ajax ) {
QUnit.test( "ajax", function( assert ) {
assert.expect( 4 );
- var done = jQuery.map( new Array( 3 ), function() { return assert.async(); } );
+ var done = assert.async( 3 );
jQuery.ajax( {
type: "GET",
url: url( "mock.php?action=name&name=foo" ),
success: function( msg ) {
assert.strictEqual( msg, "bar", "Check for GET" );
- done.pop()();
+ done();
}
} );
@@ -21,14 +21,14 @@ QUnit.test( "ajax", function( assert ) {
data: "name=peter",
success: function( msg ) {
assert.strictEqual( msg, "pan", "Check for POST" );
- done.pop()();
+ done();
}
} );
jQuery( "#first" ).load( url( "name.html" ), function() {
assert.ok( /^ERROR/.test( jQuery( "#first" ).text() ),
"Check if content was injected into the DOM" );
- done.pop()();
+ done();
} );
} );
}