From 7852583980decd716f6c2ed37b1e1d7705332989 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=B6rn=20Zaefferer?= Date: Thu, 30 Aug 2012 15:20:36 +0200 Subject: [PATCH] Restore QUnit's now dead feature of using jQuery to reset the fixture. Fixes tooltip unit tests --- tests/unit/testsuite.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 4c6898fb3..06890d8d9 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -1,5 +1,7 @@ (function( $ ) { +var reset, jshintLoaded; + window.TestHelpers = {}; function includeStyle( url ) { @@ -10,6 +12,15 @@ function includeScript( url ) { document.write( "" ); } +reset = QUnit.reset; +QUnit.reset = function() { + // Ensure jQuery events and data on the fixture are properly removed + jQuery("#qunit-fixture").empty(); + // Let QUnit reset the fixture + reset.apply( this, arguments ); +}; + + QUnit.config.requireExpects = true; QUnit.config.urlConfig.push({ @@ -38,7 +49,7 @@ QUnit.config.urlConfig.push({ tooltip: "Skip running JSHint, e.g. within TestSwarm, where Jenkins runs it already" }); -var jshintLoaded = false; +jshintLoaded = false; TestHelpers.testJshint = function( module ) { if ( QUnit.urlParams.nojshint ) { return; -- 2.39.5