aboutsummaryrefslogtreecommitdiffstats
path: root/test/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'test/index.html')
-rw-r--r--test/index.html74
1 files changed, 44 insertions, 30 deletions
diff --git a/test/index.html b/test/index.html
index 013548558..3636df471 100644
--- a/test/index.html
+++ b/test/index.html
@@ -11,44 +11,58 @@
<!-- Allows us to fetch submodule tests when using a no-ajax build -->
<script src="data/jquery-1.9.1.ajax_xhr.min.js"></script>
- <script src="data/testinit.js"></script>
-
<script src="../bower_components/qunit/qunit/qunit.js"></script>
<script src="../bower_components/requirejs/require.js"></script>
- <script>loadTests = [
- "data/testrunner.js",
- "unit/core.js",
- "unit/callbacks.js",
- "unit/deferred.js",
- "unit/support.js",
- "unit/data.js",
- "unit/queue.js",
- "unit/attributes.js",
- "unit/event.js",
- "unit/selector.js",
- "unit/traversing.js",
- "unit/manipulation.js",
- "unit/wrap.js",
- "unit/css.js",
- "unit/serialize.js",
- "unit/ajax.js",
- "unit/effects.js",
- "unit/offset.js",
- "unit/dimensions.js"
- ];</script>
+ <script src="data/testinit.js"></script>
+
+ <script>
+ // Tests are always loaded async
+ QUnit.config.autostart = false;
+ function loadTests() {
+ var tests = [
+ "data/testrunner.js",
+ "unit/core.js",
+ "unit/callbacks.js",
+ "unit/deferred.js",
+ "unit/support.js",
+ "unit/data.js",
+ "unit/queue.js",
+ "unit/attributes.js",
+ "unit/event.js",
+ "unit/selector.js",
+ "unit/traversing.js",
+ "unit/manipulation.js",
+ "unit/wrap.js",
+ "unit/css.js",
+ "unit/serialize.js",
+ "unit/ajax.js",
+ "unit/effects.js",
+ "unit/offset.js",
+ "unit/dimensions.js"
+ ];
+ // Ensure load order (to preserve test numbers)
+ (function loadDep() {
+ var dep = tests.shift();
+ if ( dep ) {
+ require( [ dep ], loadDep );
+ } else {
+ // Subproject tests must be last because they replace our test fixture
+ testSubproject( "Sizzle", "../bower_components/sizzle/test/", /^unit\/.*\.js$/, function() {
+ // Call load to build module filter select element
+ QUnit.load();
+ QUnit.start();
+ });
+ }
+ })();
+ }
+ </script>
<!-- A script that includes jQuery min, dev, or AMD -->
<!-- Adds "basic" URL option, even to iframes -->
<!-- iframes will not load AMD as loading needs to be synchronous for some tests -->
- <!-- Also loads the tests above synchronously with min or dev and async with AMD -->
+ <!-- Also executes the function above to load tests -->
<script src="jquery.js"></script>
<script>
-
- // Add Sizzle tests if they not loaded by requirejs
- if ( window.testSubproject ) {
- testSubproject( "Sizzle", "../bower_components/sizzle/test/", /^unit\/.*\.js$/ );
- }
-
// html5shiv, enabling HTML5 elements to be used with jQuery
( "abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup " +
"mark meter nav output progress section summary time video"