Skip to content

Commit

Permalink
Tests: Properly reset QUnit's fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
leobalter committed Dec 4, 2014
1 parent cbaaf28 commit 6ba8d7f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/data/testrunner.js
Expand Up @@ -7,7 +7,8 @@ var oldCacheLength = 0,

expectedDataKeys = {},
splice = [].splice,
ajaxSettings = jQuery.ajaxSettings;
ajaxSettings = jQuery.ajaxSettings,
fixture = document.getElementById( "qunit-fixture" ).innerHTML;

/**
* QUnit configuration
Expand Down Expand Up @@ -161,7 +162,7 @@ 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();
supportjQuery( "#qunit-fixture" ).empty().html( fixture );

// Reset internal jQuery state
jQuery.event.global = {};
Expand Down

0 comments on commit 6ba8d7f

Please sign in to comment.