Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests: Remove one of the checks for memory leak
This check is redundant since jQuery.fragments object does not exist anymore
(cherry-picked from 38c122a)
  • Loading branch information
markelog committed Jan 14, 2014
1 parent 3fbbe93 commit a3cd88f
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions test/data/testrunner.js
Expand Up @@ -7,7 +7,6 @@ var oldStart = window.start,
// Store the old counts so that we only assert on tests that have actually leaked,
// instead of asserting every time a test has leaked sometime in the past
oldCacheLength = 0,
oldFragmentsLength = 0,
oldActive = 0,

expectedDataKeys = {},
Expand Down Expand Up @@ -118,7 +117,6 @@ QUnit.config.urlConfig.push({
window.moduleTeardown = function() {
var i,
expectedKeys, actualKeys,
fragmentsLength = 0,
cacheLength = 0;

// Only look for jQuery data problems if this test actually
Expand Down Expand Up @@ -163,22 +161,12 @@ window.moduleTeardown = function() {
++cacheLength;
}

jQuery.fragments = {};

for ( i in jQuery.fragments ) {
++fragmentsLength;
}

// Because QUnit doesn't have a mechanism for retrieving the number of expected assertions for a test,
// if we unconditionally assert any of these, the test will fail with too many assertions :|
if ( cacheLength !== oldCacheLength ) {
equal( cacheLength, oldCacheLength, "No unit tests leak memory in jQuery.cache" );
oldCacheLength = cacheLength;
}
if ( fragmentsLength !== oldFragmentsLength ) {
equal( fragmentsLength, oldFragmentsLength, "No unit tests leak memory in jQuery.fragments" );
oldFragmentsLength = fragmentsLength;
}
};

QUnit.done(function() {
Expand Down

0 comments on commit a3cd88f

Please sign in to comment.