]> source.dussan.org Git - jquery.git/commitdiff
Tests: Use QUnit URL parameter parsing
authorRichard Gibson <richard.gibson@gmail.com>
Tue, 8 Sep 2015 20:03:10 +0000 (16:03 -0400)
committerRichard Gibson <richard.gibson@gmail.com>
Fri, 9 Oct 2015 03:29:32 +0000 (23:29 -0400)
test/data/testinit.js

index 68de5e3361b5a105bfea2e5490f58fc744100279..903bc9c3451522889b99ea33f63cfc1c253ea221 100644 (file)
@@ -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() {