X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fqunit%2Fdata%2Ftestrunner.js;h=2eda8f1504f8322e218025a254e9e87e4143fce3;hb=5203b9bb237766305d6b80a649754ff51c8928ad;hp=ab9aab19d3df10693efd48a6be6b8146d46baec3;hpb=2e040b99eda6c99cf472b3896f62d2f21315e808;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index ab9aab19d3..2eda8f1504 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -136,6 +136,12 @@ return true; } + // Don't iterate over the module registry (the 'script' references would + // be listed as untested methods otherwise) + if ( val === mw.loader.moduleRegistry ) { + return true; + } + return false; }; @@ -234,6 +240,19 @@ // As a convenience feature, automatically restore warnings if they're // still suppressed by the end of the test. restoreWarnings(); + + // Check for incomplete animations/requests/etc and throw + // error if there are any. + if ( $.timers && $.timers.length !== 0 ) { + // Test may need to use fake timers, wait for animations or + // call $.fx.stop(). + throw new Error( 'Unfinished animations: ' + $.timers.length ); + } + if ( $.active !== undefined && $.active !== 0 ) { + // Test may need to use fake XHR, wait for requests or + // call abort(). + throw new Error( 'Unfinished AJAX requests: ' + $.active ); + } } }; };