aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2015-09-08 16:03:10 -0400
committerRichard Gibson <richard.gibson@gmail.com>2015-10-08 23:32:05 -0400
commitfb98ea49b63ec444bb6f24c65b49a3e6cebcfc99 (patch)
tree199abda9d09a0abd96a40b06122ff99a192401c9
parent5fb689debcab0e9b0969d595b03b911d974eca1f (diff)
downloadjquery-fb98ea49b63ec444bb6f24c65b49a3e6cebcfc99.tar.gz
jquery-fb98ea49b63ec444bb6f24c65b49a3e6cebcfc99.zip
Tests: Use QUnit URL parameter parsing
(cherry picked from commit f23a64d745759d358d423ba0557e8f74d65f76cc)
-rw-r--r--test/data/testinit.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/test/data/testinit.js b/test/data/testinit.js
index 68de5e336..903bc9c34 100644
--- a/test/data/testinit.js
+++ b/test/data/testinit.js
@@ -269,12 +269,9 @@ this.iframeCallback = undefined;
// Tests are always loaded async
QUnit.config.autostart = false;
this.loadTests = function() {
- var loadSwarm,
- url = window.location.search,
- basicTests = jQuery.inArray( "module=basic", url.substring( 1 ).split( "&" ) ) > -1;
-
- url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
- loadSwarm = url && url.indexOf( "http" ) === 0;
+ // Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
+ var loadSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0,
+ basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";
// Get testSubproject from testrunner first
require( [ "data/testrunner.js" ], function() {