Follow-up to r89243 to fix the async qunit test
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Jun 2011 01:24:45 +0000 (01:24 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Jun 2011 01:24:45 +0000 (01:24 +0000)
Per CR & IRC discussion; added the missing stop() & start() calls, and using the timeout parameter for stop() so we can actually detect the regression (original bug caused neither the success nor failure callbacks to fire, so the test runner would just stop)

tests/qunit/suites/resources/mediawiki/mediawiki.js

index 7bace45..6b890b5 100644 (file)
@@ -176,8 +176,13 @@ test( 'mw.loader', function(){
 test( 'mw.loader.bug29107' , function() {
        expect( 1 );
 
+       // Async! Include a timeout, as failure on this bug lead to neither the
+       // success nor failure callbacks getting called.
+       stop(1500);
+
        mw.loader.implement( 'bug29107.messages-only', [], {}, {'bug29107': 'loaded'} );
        mw.loader.using( 'bug29107.messages-only', function() {
+               start();
                ok( mw.messages.exists( 'bug29107' ), 'Bug 29107: messages-only module should load ok' );
        }, function(){
                start();