aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/ready.js
diff options
context:
space:
mode:
authorMichał Gołębiowski-Owczarek <m.goleb@gmail.com>2020-03-02 22:15:06 +0100
committerGitHub <noreply@github.com>2020-03-02 22:15:06 +0100
commit364476c3dc1231603ba61fc08068fa89fb095e1a (patch)
tree4358806e0f0312105875379a6bd1b33785e22c06 /test/unit/ready.js
parent721744a9fab5b597febea64e466272eabfdb9463 (diff)
downloadjquery-364476c3dc1231603ba61fc08068fa89fb095e1a.tar.gz
jquery-364476c3dc1231603ba61fc08068fa89fb095e1a.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
Diffstat (limited to 'test/unit/ready.js')
-rw-r--r--test/unit/ready.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/ready.js b/test/unit/ready.js
index fd33c0a18..d1a728b47 100644
--- a/test/unit/ready.js
+++ b/test/unit/ready.js
@@ -107,31 +107,31 @@ QUnit.module( "ready" );
QUnit[ jQuery.when ? "test" : "skip" ]( "jQuery.when(jQuery.ready)", function( assert ) {
assert.expect( 2 );
- var done = jQuery.map( new Array( 2 ), function() { return assert.async(); } );
+ var done = assert.async( 2 );
whenified.then( function() {
assert.ok( jQuery.isReady, "jQuery.when Deferred resolved" );
- done.pop()();
+ done();
} );
jQuery.when( jQuery.ready ).then( function() {
assert.ok( jQuery.isReady, "jQuery.when Deferred resolved" );
- done.pop()();
+ done();
} );
} );
QUnit.test( "Promise.resolve(jQuery.ready)", function( assert ) {
assert.expect( 2 );
- var done = jQuery.map( new Array( 2 ), function() { return assert.async(); } );
+ var done = assert.async( 2 );
promisified.then( function() {
assert.ok( jQuery.isReady, "Native promised resolved" );
- done.pop()();
+ done();
} );
Promise.resolve( jQuery.ready ).then( function() {
assert.ok( jQuery.isReady, "Native promised resolved" );
- done.pop()();
+ done();
} );
} );