Skip to content

Commit

Permalink
Tests: Use QUnit URL parameter parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
gibson042 committed Oct 9, 2015
1 parent f9af896 commit f23a64d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test/data/testinit.js
Expand Up @@ -269,12 +269,9 @@ this.iframeCallback = undefined;
// Tests are always loaded async // Tests are always loaded async
QUnit.config.autostart = false; QUnit.config.autostart = false;
this.loadTests = function() { this.loadTests = function() {
var loadSwarm, // Leverage QUnit URL parsing to detect testSwarm environment and "basic" testing mode
url = window.location.search, var loadSwarm = ( QUnit.urlParams[ "swarmURL" ] + "" ).indexOf( "http" ) === 0,
basicTests = jQuery.inArray( "module=basic", url.substring( 1 ).split( "&" ) ) > -1; basicTests = ( QUnit.urlParams[ "module" ] + "" ) === "basic";

url = decodeURIComponent( url.slice( url.indexOf( "swarmURL=" ) + "swarmURL=".length ) );
loadSwarm = url && url.indexOf( "http" ) === 0;


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

0 comments on commit f23a64d

Please sign in to comment.