Skip to content

Commit f23a64d

Browse files
committed
Tests: Use QUnit URL parameter parsing
1 parent f9af896 commit f23a64d

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/data/testinit.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,12 +269,9 @@ this.iframeCallback = undefined;
269269
// Tests are always loaded async
270270
QUnit.config.autostart = false;
271271
this.loadTests = function() {
272-
var loadSwarm,
273-
url = window.location.search,
274-
basicTests = jQuery.inArray( "module=basic", url.substring( 1 ).split( "&" ) ) > -1;
275-
276-
url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
277-
loadSwarm = url && url.indexOf( "http" ) === 0;
272+
// Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
273+
var loadSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0,
274+
basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
278275

279276
// Get testSubproject from testrunner first
280277
require( [ "data/testrunner.js" ], function() {

0 commit comments

Comments
 (0)