diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:30:02 -0400 |
commit | 1de335ad3f395ca6861085393ba366a9e3fb4a0d (patch) | |
tree | f1fdd326034e05177596851be6a7127615d81498 /tests/qunit/data | |
parent | 9c75fa8ff6d4d38ef552c00fef5969fb154765e8 (diff) | |
parent | f6d65e533c62f6deb21342d4901ece24497b433e (diff) |
Merge commit 'f6d65'
# Conflicts:
# skins/ArchLinux/ArchLinux.php
Diffstat (limited to 'tests/qunit/data')
-rw-r--r-- | tests/qunit/data/testrunner.js | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index db312b21..03aaf4af 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -26,32 +26,20 @@ */ // When a test() indicates asynchronicity with stop(), - // allow 10 seconds to pass before killing the test(), + // allow 30 seconds to pass before killing the test(), // and assuming failure. - QUnit.config.testTimeout = 10 * 1000; + QUnit.config.testTimeout = 30 * 1000; + + QUnit.config.requireExpects = true; // Add a checkbox to QUnit header to toggle MediaWiki ResourceLoader debug mode. QUnit.config.urlConfig.push( { id: 'debug', label: 'Enable ResourceLoaderDebug', - tooltip: 'Enable debug mode in ResourceLoader' + tooltip: 'Enable debug mode in ResourceLoader', + value: 'true' } ); - QUnit.config.requireExpects = true; - - /** - * Load TestSwarm agent - */ - // Only if the current url indicates that there is a TestSwarm instance watching us - // (TestSwarm appends swarmURL to the test suites url it loads in iframes). - // Otherwise this is just a simple view of Special:JavaScriptTest/qunit directly, - // no point in loading inject.js in that case. Also, make sure that this instance - // of MediaWiki has actually been configured with the required url to that inject.js - // script. By default it is false. - if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) { - jQuery.getScript( QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) ); - } - /** * CompletenessTest * @@ -256,6 +244,7 @@ }, teardown: function () { + var timers; log( 'MwEnvironment> TEARDOWN for "' + QUnit.config.current.module + ': ' + QUnit.config.current.testName + '"' ); @@ -272,9 +261,18 @@ // 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 ); + timers = $.timers.length; + // Tests shoulld use fake timers or wait for animations to complete + $.each( $.timers, function ( i, timer ) { + var node = timer.elem; + mw.log.warn( 'Unfinished animation #' + i + ' in ' + timer.queue + ' queue on ' + + mw.html.element( node.nodeName.toLowerCase(), $(node).getAttrs() ) + ); + } ); + // Force animations to stop to give the next test a clean start + $.fx.stop(); + + throw new Error( 'Unfinished animations: ' + timers ); } if ( $.active !== undefined && $.active !== 0 ) { // Test may need to use fake XHR, wait for requests or |