aboutsummaryrefslogtreecommitdiffstats
path: root/test/index.html
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-06-15 08:22:58 -0500
committerRick Waldron <waldron.rick@gmail.com>2012-06-15 08:23:42 -0500
commita7430dfb12f2bcf10bd51ec0bab4832791c0aa9f (patch)
treef6c7b6f9c025ceffab9d6f326778bf7b06a872c4 /test/index.html
parent8f944a1b5c0abce054cf9e6ac4010c782557ce26 (diff)
downloadjquery-a7430dfb12f2bcf10bd51ec0bab4832791c0aa9f.tar.gz
jquery-a7430dfb12f2bcf10bd51ec0bab4832791c0aa9f.zip
Use QUnit's URL configs to simplify custom configuration. Closes gh-827
Diffstat (limited to 'test/index.html')
-rw-r--r--test/index.html44
1 files changed, 16 insertions, 28 deletions
diff --git a/test/index.html b/test/index.html
index 07c06813f..351383086 100644
--- a/test/index.html
+++ b/test/index.html
@@ -9,35 +9,26 @@
<script src="data/testinit.js"></script>
- <!-- Loads minified version if version=min is present in the search -->
- <!-- Nullifies querySelectorAll if qsa=no is present -->
+ <script src="qunit/qunit/qunit.js"></script>
+ <!-- Loads minified version if min=true is present in the search -->
+ <!-- Nullifies querySelectorAll if noqsa=true is present -->
<script>
(function() {
- var set, keyvals, params,
- version = "";
-
- if ( location.search ) {
- keyvals = location.search.slice(1).split("&"),
- params = {};
-
- while ( keyvals.length ) {
- set = keyvals.shift().split("=");
- params[ set[0] ] = set[1];
- }
- if ( params.version && params.version === "min" ) {
- version = params.version + ".";
- }
- if ( params.qsa && params.qsa === "no" ) {
- document.querySelectorAll = null;
- }
+ var src = "../dist/jquery.js";
+
+ QUnit.config.urlConfig.push( "min" );
+ if ( QUnit.urlParams.min ) {
+ src = "../dist/jquery.min.js";
+ }
+
+ QUnit.config.urlConfig.push( "noqsa" );
+ if ( QUnit.urlParams.noqsa ) {
+ document.querySelectorAll = null;
}
- document.write(
- "<script src='../dist/jquery." + version + "js'><\/script>"
- );
+
+ document.write( "<script src='" + src + "'><\/script>" );
})();
</script>
-
- <script src="qunit/qunit/qunit.js"></script>
<script src="data/testrunner.js"></script>
<script src="unit/core.js"></script>
@@ -70,10 +61,7 @@
</head>
<body id="body">
- <h1 id="qunit-header"><a href="/jquery/test/index.html">jQuery Test Suite</a>
- <a href="?version=min">(minified)</a>
- <a href="?qsa=no">(-querySelectorAll)</a>
- </h1>
+ <h1 id="qunit-header"><a href="/jquery/test/index.html">jQuery Test Suite</a></h1>
<h2 id="qunit-banner"></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>