aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2015-04-17 10:47:23 -0400
committerScott González <scott.gonzalez@gmail.com>2015-04-17 13:45:13 -0400
commit1d193c24dc3f860e0d03d9e66495701b8e69789b (patch)
tree5234d5490b8eeab02c1667ccd437f5f511fc27c9 /tests/lib
parent6231b161b92d28bdb6657cdd1f7d11436e6b132d (diff)
downloadjquery-ui-1d193c24dc3f860e0d03d9e66495701b8e69789b.tar.gz
jquery-ui-1d193c24dc3f860e0d03d9e66495701b8e69789b.zip
Tests: Fix loading in TestSwarm
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/bootstrap.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/tests/lib/bootstrap.js b/tests/lib/bootstrap.js
index a381394a8..1c5527816 100644
--- a/tests/lib/bootstrap.js
+++ b/tests/lib/bootstrap.js
@@ -12,13 +12,15 @@ requirejs.config({
"qunit-assert-classes": "../../../external/qunit-assert-classes/qunit-assert-classes",
"qunit-assert-close": "../../../external/qunit-assert-close/qunit-assert-close",
"qunit": "../../../external/qunit/qunit",
+ "testswarm": "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime(),
"ui": "../../../ui"
},
shim: {
"globalize/ja-JP": [ "globalize" ],
"jquery-simulate": [ "jquery" ],
"qunit-assert-classes": [ "qunit" ],
- "qunit-assert-close": [ "qunit" ]
+ "qunit-assert-close": [ "qunit" ],
+ "testswarm": [ "qunit" ]
}
});
@@ -62,8 +64,12 @@ function requireTests( dependencies, noBackCompat ) {
"jquery-simulate"
].concat( dependencies );
+ // Load the TestSwarm injector, if necessary
+ if ( parseUrl().swarmURL ) {
+ dependencies.push( "testswarm" );
+ }
+
requireModules( dependencies, function( QUnit ) {
- swarmInject();
QUnit.start();
} );
}
@@ -97,17 +103,6 @@ function jqueryUrl() {
return url;
}
-function swarmInject() {
- var url = parseUrl().swarmURL;
-
- if ( !url || url.indexOf( "http" ) !== 0 ) {
- return;
- }
-
- document.write( "<script src='http://swarm.jquery.org/js/inject.js?" +
- (new Date()).getTime() + "'></script>" );
-}
-
// Load test modules based on data attributes
// - data-modules: list of test modules to load
// - data-widget: A widget to load test modules for