aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/qunit.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/qunit.js')
-rw-r--r--tests/lib/qunit.js23
1 files changed, 15 insertions, 8 deletions
diff --git a/tests/lib/qunit.js b/tests/lib/qunit.js
index 6441019bd..c4c96ef58 100644
--- a/tests/lib/qunit.js
+++ b/tests/lib/qunit.js
@@ -7,6 +7,8 @@ define( [
], function( QUnit, $ ) {
"use strict";
+var ajaxSettings = $.ajaxSettings;
+
QUnit.config.autostart = false;
QUnit.config.requireExpects = true;
@@ -34,16 +36,21 @@ QUnit.config.urlConfig.push( {
label: "Enable jquery-migrate"
} );
-QUnit.reset = ( function( reset ) {
- return function() {
+QUnit.testDone( function() {
+
+ // Ensure jQuery events and data on the fixture are properly removed
+ $( "#qunit-fixture" ).empty();
- // Ensure jQuery events and data on the fixture are properly removed
- $( "#qunit-fixture" ).empty();
+ // Remove the iframe fixture
+ $( "#qunit-fixture-iframe" ).remove();
- // Let QUnit reset the fixture
- reset.apply( this, arguments );
- };
-} )( QUnit.reset );
+ // Reset internal $ state
+ if ( ajaxSettings ) {
+ $.ajaxSettings = $.extend( true, {}, ajaxSettings );
+ } else {
+ delete $.ajaxSettings;
+ }
+} );
return QUnit;