1 // Use the right jQuery source on the test page (and iframes)
3 /* global loadTests: false */
6 path = window.location.pathname.split( "test" )[ 0 ],
7 QUnit = window.QUnit || parent.QUnit,
8 require = window.require || parent.require;
10 // iFrames won't load AMD (the iframe tests synchronously expect jQuery to be there)
11 QUnit.config.urlConfig.push({
13 label: "Load with AMD",
14 tooltip: "Load the AMD jQuery file (and its dependencies)"
16 // If QUnit is on window, this is the main window
17 // This detection allows AMD tests to be run in an iframe
18 if ( QUnit.urlParams.amd && window.QUnit ) {
22 sizzle: "external/sizzle/dist/sizzle"
26 // Include tests if specified
27 if ( typeof loadTests !== "undefined" ) {
28 require( [ src ], loadTests );
35 // Config parameter to use minified jQuery
36 QUnit.config.urlConfig.push({
38 label: "Load unminified",
39 tooltip: "Load the development (unminified) jQuery file"
41 if ( QUnit.urlParams.dev ) {
42 src = "dist/jquery.js";
44 src = "dist/jquery.min.js";
48 document.write( "<script id='jquery-js' src='" + path + src + "'><\x2Fscript>" );
50 // Synchronous-only tests
51 // Other tests are loaded from the test page
52 if ( typeof loadTests !== "undefined" ) {
53 document.write( "<script src='" + path + "test/unit/ready.js'><\x2Fscript>");