Tests: Bring back some of the clean-up logic

This commit is contained in:
Oleg Gaidarenko
2014-04-05 18:23:03 +04:00
parent 4f14bea2c2
commit 1dedd3185e

View File

@@ -138,8 +138,19 @@ window.moduleTeardown = function() {
}
};
QUnit.done(function() {
// Remove our own fixtures outside #qunit-fixture
supportjQuery( "#qunit ~ *" ).remove();
});
QUnit.testDone(function() {
// Ensure jQuery events and data on the fixture are properly removed
jQuery( "#qunit-fixture" ).empty();
// ...even if the jQuery under test has a broken .empty()
supportjQuery( "#qunit-fixture" ).empty();
// Reset internal jQuery state
jQuery.event.global = {};
if ( ajaxSettings ) {