diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2020-01-27 18:54:47 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-27 18:54:47 +0100 |
commit | d525ae3416417186330bb3d14133df84509803a0 (patch) | |
tree | 7f6920f6228a5d8934f539abba28f8f8ed756191 /test/unit/ready.js | |
parent | 7a3cf9c03cc34d5493383852f94d96fe4a3486ef (diff) | |
download | jquery-d525ae3416417186330bb3d14133df84509803a0.tar.gz jquery-d525ae3416417186330bb3d14133df84509803a0.zip |
Build:Tests: Fix custom build tests, verify on Travis; name Travis jobs
This commit fixes unit tests for the following builds:
1. The no-deprecated build: `custom:-deprecated`
2. The current slim build: `custom:-ajax,-effects`
3. The 4.0 (#4553) slim build: `custom:-ajax,-callbacks,-deferred,-effects`
It also adds separate Travis jobs for the no-deprecated & slim builds.
Apart from that, add intuitive names to Travis jobs. Otherwise it's hard to see
at a glance that a particular job is running on Firefox ESR, for example.
Ref gh-4577
Ref gh-4596
Closes gh-4600
Diffstat (limited to 'test/unit/ready.js')
-rw-r--r-- | test/unit/ready.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/test/unit/ready.js b/test/unit/ready.js index d3396b1c4..fd33c0a18 100644 --- a/test/unit/ready.js +++ b/test/unit/ready.js @@ -2,7 +2,7 @@ QUnit.module( "ready" ); ( function() { var notYetReady, noEarlyExecution, - whenified = jQuery.when( jQuery.ready ), + whenified = jQuery.when && jQuery.when( jQuery.ready ), promisified = Promise.resolve( jQuery.ready ), start = new Date(), order = [], @@ -105,7 +105,7 @@ QUnit.module( "ready" ); } ); } ); - QUnit.test( "jQuery.when(jQuery.ready)", function( assert ) { + 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(); } ); @@ -149,15 +149,18 @@ QUnit.module( "ready" ); } ); } ); - testIframe( - "holdReady test needs to be a standalone test since it deals with DOM ready", - "readywait.html", - function( assert, jQuery, window, document, releaseCalled ) { - assert.expect( 2 ); - var now = new Date(); - assert.ok( now - start >= 300, "Needs to have waited at least half a second" ); - assert.ok( releaseCalled, "The release function was called, which resulted in ready" ); - } - ); + // jQuery.holdReady is deprecated, skip the test if it was excluded. + if ( jQuery.holdReady ) { + testIframe( + "holdReady test needs to be a standalone test since it deals with DOM ready", + "readywait.html", + function( assert, jQuery, window, document, releaseCalled ) { + assert.expect( 2 ); + var now = new Date(); + assert.ok( now - start >= 300, "Needs to have waited at least half a second" ); + assert.ok( releaseCalled, "The release function was called, which resulted in ready" ); + } + ); + } } )(); |