Skip to content

Commit 1d193c2

Browse files
committed
Tests: Fix loading in TestSwarm
1 parent 6231b16 commit 1d193c2

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

tests/lib/bootstrap.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ requirejs.config({
1212
"qunit-assert-classes": "../../../external/qunit-assert-classes/qunit-assert-classes",
1313
"qunit-assert-close": "../../../external/qunit-assert-close/qunit-assert-close",
1414
"qunit": "../../../external/qunit/qunit",
15+
"testswarm": "http://swarm.jquery.org/js/inject.js?" + (new Date()).getTime(),
1516
"ui": "../../../ui"
1617
},
1718
shim: {
1819
"globalize/ja-JP": [ "globalize" ],
1920
"jquery-simulate": [ "jquery" ],
2021
"qunit-assert-classes": [ "qunit" ],
21-
"qunit-assert-close": [ "qunit" ]
22+
"qunit-assert-close": [ "qunit" ],
23+
"testswarm": [ "qunit" ]
2224
}
2325
});
2426

@@ -62,8 +64,12 @@ function requireTests( dependencies, noBackCompat ) {
6264
"jquery-simulate"
6365
].concat( dependencies );
6466

67+
// Load the TestSwarm injector, if necessary
68+
if ( parseUrl().swarmURL ) {
69+
dependencies.push( "testswarm" );
70+
}
71+
6572
requireModules( dependencies, function( QUnit ) {
66-
swarmInject();
6773
QUnit.start();
6874
} );
6975
}
@@ -97,17 +103,6 @@ function jqueryUrl() {
97103
return url;
98104
}
99105

100-
function swarmInject() {
101-
var url = parseUrl().swarmURL;
102-
103-
if ( !url || url.indexOf( "http" ) !== 0 ) {
104-
return;
105-
}
106-
107-
document.write( "<script src='http://swarm.jquery.org/js/inject.js?" +
108-
(new Date()).getTime() + "'></script>" );
109-
}
110-
111106
// Load test modules based on data attributes
112107
// - data-modules: list of test modules to load
113108
// - data-widget: A widget to load test modules for

0 commit comments

Comments
 (0)