Skip to content

Commit 516d553

Browse files
committed
Added dynamic jQuery version loader to QUnit test suite.
1 parent 550b176 commit 516d553

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

test/index.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@
44
<meta charset="utf-8" />
55
<title>PowerTip Test Suite</title>
66

7-
<!-- Library Resources -->
8-
<script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.js"></script>
7+
<!-- QUnit Resources -->
98
<script type="text/javascript" src="https://code.jquery.com/qunit/qunit-2.0.0.js"></script>
109
<link rel="stylesheet" type="text/css" href="https://code.jquery.com/qunit/qunit-2.0.0.css" />
1110

11+
<!-- Dynamic jQuery Version Loader -->
12+
<script type="text/javascript">
13+
var jqVersions = [ '1.7.0', '1.12.4', '2.2.4', '3.0.0' ],
14+
currentJq = QUnit.urlParams.jquery || jqVersions[jqVersions.length - 1];
15+
16+
QUnit.config.urlConfig.push({
17+
id: 'jquery',
18+
label: 'jQuery version',
19+
value: jqVersions,
20+
tooltip: 'Select which version of jQuery to run the test suite on.'
21+
});
22+
23+
document.write('<script src="https://code.jquery.com/jquery-' + currentJq + '.js">\x3C/script>');
24+
</script>
25+
1226
<!-- PowerTip Core Resources -->
1327
<script type="text/javascript" src="../src/core.js"></script>
1428
<script type="text/javascript" src="../src/csscoordinates.js"></script>

0 commit comments

Comments
 (0)