Skip to content

Commit 7852583

Browse files
committed
Restore QUnit's now dead feature of using jQuery to reset the fixture. Fixes tooltip unit tests
1 parent 0164db1 commit 7852583

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/unit/testsuite.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
(function( $ ) {
22

3+
var reset, jshintLoaded;
4+
35
window.TestHelpers = {};
46

57
function includeStyle( url ) {
@@ -10,6 +12,15 @@ function includeScript( url ) {
1012
document.write( "<script src='../../../" + url + "'></script>" );
1113
}
1214

15+
reset = QUnit.reset;
16+
QUnit.reset = function() {
17+
// Ensure jQuery events and data on the fixture are properly removed
18+
jQuery("#qunit-fixture").empty();
19+
// Let QUnit reset the fixture
20+
reset.apply( this, arguments );
21+
};
22+
23+
1324
QUnit.config.requireExpects = true;
1425

1526
QUnit.config.urlConfig.push({
@@ -38,7 +49,7 @@ QUnit.config.urlConfig.push({
3849
tooltip: "Skip running JSHint, e.g. within TestSwarm, where Jenkins runs it already"
3950
});
4051

41-
var jshintLoaded = false;
52+
jshintLoaded = false;
4253
TestHelpers.testJshint = function( module ) {
4354
if ( QUnit.urlParams.nojshint ) {
4455
return;

0 commit comments

Comments
 (0)