From 2b2ca8baa3e220f086f3a5d99c1bb84b5d5bd7c5 Mon Sep 17 00:00:00 2001 From: Dave Methvin Date: Sun, 19 Aug 2012 21:09:13 -0400 Subject: [PATCH] Don't expect QUnit to clean up jQuery internal data. Close gh-883. --- test/data/testrunner.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/data/testrunner.js b/test/data/testrunner.js index cceacfc12..70bbc88c3 100644 --- a/test/data/testrunner.js +++ b/test/data/testrunner.js @@ -136,9 +136,16 @@ function testSubproject( label, url, risTests ) { ajaxSettings = jQuery.ajaxSettings; QUnit.reset = function() { - reset.apply(this, arguments); + + // Ensure jQuery events and data on the fixture are properly removed + jQuery("#qunit-fixture").empty(); + + // Reset internal jQuery state jQuery.event.global = {}; - jQuery.ajaxSettings = jQuery.extend({}, ajaxSettings); + jQuery.ajaxSettings = jQuery.extend( {}, ajaxSettings ); + + // Let QUnit reset the fixture + reset.apply( this, arguments ); }; })(); -- 2.39.5