SpecialJavaScriptTest: Do not accidentally pass parameters to QUnit.start()
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 27 Apr 2017 18:19:32 +0000 (20:19 +0200)
committerBartosz Dziewoński <matma.rex@gmail.com>
Thu, 27 Apr 2017 18:19:32 +0000 (20:19 +0200)
If the mw.loader.using() call's promise is rejected, we end up
passing an Error object as the 'count' parameter to QUnit.start().
This seems to be harmless, but is very confusing when debugging.

Change-Id: I44caca5285dbced5a5876d9d7ff6236dbd3efc35

includes/specials/SpecialJavaScriptTest.php

index 6fbac8a..52064b7 100644 (file)
@@ -140,7 +140,9 @@ class SpecialJavaScriptTest extends SpecialPage {
        var start = window.__karma__ ? window.__karma__.start : QUnit.start;
        try {
                mw.loader.using( $modules )
-                       .always( start )
+                       .always( function () {
+                               start();
+                       } )
                        .fail( function ( e ) { throw e; } );
        } catch ( e ) {
                start();