Restore QUnit's now dead feature of using jQuery to reset the fixture. Fixes tooltip unit tests

This commit is contained in:
Jörn Zaefferer 2012-08-30 15:20:36 +02:00
parent 0164db1e0d
commit 7852583980

View File

@ -1,5 +1,7 @@
(function( $ ) { (function( $ ) {
var reset, jshintLoaded;
window.TestHelpers = {}; window.TestHelpers = {};
function includeStyle( url ) { function includeStyle( url ) {
@ -10,6 +12,15 @@ function includeScript( url ) {
document.write( "<script src='../../../" + url + "'></script>" ); document.write( "<script src='../../../" + url + "'></script>" );
} }
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.requireExpects = true;
QUnit.config.urlConfig.push({ 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" tooltip: "Skip running JSHint, e.g. within TestSwarm, where Jenkins runs it already"
}); });
var jshintLoaded = false; jshintLoaded = false;
TestHelpers.testJshint = function( module ) { TestHelpers.testJshint = function( module ) {
if ( QUnit.urlParams.nojshint ) { if ( QUnit.urlParams.nojshint ) {
return; return;