diff options
Diffstat (limited to 'tests/lib/qunit.js')
-rw-r--r-- | tests/lib/qunit.js | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/tests/lib/qunit.js b/tests/lib/qunit.js index cc2f01d79..c4c96ef58 100644 --- a/tests/lib/qunit.js +++ b/tests/lib/qunit.js @@ -7,14 +7,14 @@ define( [ ], function( QUnit, $ ) { "use strict"; +var ajaxSettings = $.ajaxSettings; + QUnit.config.autostart = false; QUnit.config.requireExpects = true; QUnit.config.urlConfig.push( { id: "jquery", label: "jQuery version", - - // Keep in sync with tests/runner/jquery.js value: [ "1.12.4", "2.2.4", @@ -36,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(); - // Let QUnit reset the fixture - reset.apply( this, arguments ); - }; -} )( QUnit.reset ); + // Remove the iframe fixture + $( "#qunit-fixture-iframe" ).remove(); + + // Reset internal $ state + if ( ajaxSettings ) { + $.ajaxSettings = $.extend( true, {}, ajaxSettings ); + } else { + delete $.ajaxSettings; + } +} ); return QUnit; |