aboutsummaryrefslogtreecommitdiffstats
path: root/test/jquery.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/jquery.js')
-rw-r--r--test/jquery.js13
1 files changed, 4 insertions, 9 deletions
diff --git a/test/jquery.js b/test/jquery.js
index 0340fb6e0..a8a800d24 100644
--- a/test/jquery.js
+++ b/test/jquery.js
@@ -3,13 +3,8 @@
/* global loadTests: false */
var dynamicImportSource, config, src,
- FILEPATH = "/test/jquery.js",
- activeScript = [].slice.call( document.getElementsByTagName( "script" ), -1 )[ 0 ],
- parentUrl = activeScript && activeScript.src ?
- activeScript.src.replace( /[?#].*/, "" ) + FILEPATH.replace( /[^/]+/g, ".." ) + "/" :
- "../",
- QUnit = window.QUnit,
- require = window.require;
+ parentUrl = window.location.protocol + "//" + window.location.host,
+ QUnit = window.QUnit;
function getQUnitConfig() {
var config = Object.create( null );
@@ -58,7 +53,7 @@
// IE doesn't support the dynamic import syntax so it would crash
// with a SyntaxError here.
dynamicImportSource = "" +
- "import( `${ parentUrl }src/jquery.js` )\n" +
+ "import( `${ parentUrl }/src/jquery.js` )\n" +
" .then( ( { jQuery } ) => {\n" +
" window.jQuery = jQuery;\n" +
" if ( typeof loadTests === \"function\" ) {\n" +
@@ -75,7 +70,7 @@
// Otherwise, load synchronously
} else {
- document.write( "<script id='jquery-js' nonce='jquery+hardcoded+nonce' src='" + parentUrl + src + "'><\x2Fscript>" );
+ document.write( "<script id='jquery-js' nonce='jquery+hardcoded+nonce' src='" + parentUrl + "/" + src + "'><\x2Fscript>" );
}
} )();