diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2015-09-08 15:56:08 -0400 |
---|---|---|
committer | Richard Gibson <richard.gibson@gmail.com> | 2015-10-08 23:26:03 -0400 |
commit | f9af896bb8f4cb37b22d508443174c8edf40fc54 (patch) | |
tree | 77405e1f1598821fc58ea88fdaa2a6753c5da833 /test/data | |
parent | 99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea (diff) | |
download | jquery-f9af896bb8f4cb37b22d508443174c8edf40fc54.tar.gz jquery-f9af896bb8f4cb37b22d508443174c8edf40fc54.zip |
Tests: Add dummy modules when running basic tests
Without this, other modules don't appear in the QUnit module picker.
Ref 855b0c8c288533948b257925a8906f7da3449eed
Closes gh-2582
Diffstat (limited to 'test/data')
-rw-r--r-- | test/data/testinit.js | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js index fb99badfc..68de5e336 100644 --- a/test/data/testinit.js +++ b/test/data/testinit.js @@ -278,20 +278,14 @@ this.loadTests = function() { // Get testSubproject from testrunner first require( [ "data/testrunner.js" ], function() { - var tests = [] - .concat( [ - + var i = 0, + tests = [ // A special module with basic tests, meant for // not fully supported environments like Android 2.3, // jsdom or PhantomJS. We run it everywhere, though, // to make sure tests are not broken. - // - // Support: Android 2.3 only - // When loading basic tests don't load any others to not - // overload Android 2.3. - "unit/basic.js" - ] ) - .concat( basicTests ? [] : [ + "unit/basic.js", + "unit/core.js", "unit/callbacks.js", "unit/deferred.js", @@ -312,14 +306,23 @@ this.loadTests = function() { "unit/dimensions.js", "unit/animation.js", "unit/tween.js" - ] ); + ]; // Ensure load order (to preserve test numbers) ( function loadDep() { - var dep = tests.shift(); + var dep = tests[ i++ ]; if ( dep ) { - require( [ dep ], loadDep ); + if ( !basicTests || i === 1 ) { + require( [ dep ], loadDep ); + + // Support: Android 2.3 only + // When running basic tests, replace other modules with dummies to avoid overloading + // impaired clients. + } else { + QUnit.module( dep.replace( /^.*\/|\.js$/g, "" ) ); + loadDep(); + } } else { QUnit.load(); |