From: Stephane Bisson Date: Tue, 31 Jan 2017 16:21:00 +0000 (-0500) Subject: Special:JavaScriptTest: send RL errors to the js console X-Git-Tag: 1.31.0-rc.0~4141^2 X-Git-Url: https://git.cyclocoop.org/%7B%7B%20url_for%28%27votes%27%2C%20votes=%27waiting%27%29%20%7D%7D?a=commitdiff_plain;h=a976cee0e498813ba1fe264497d0d0eb9f290c4f;p=lhc%2Fweb%2Fwiklou.git Special:JavaScriptTest: send RL errors to the js console ResourceLoader errors, like invalid dependencies, are hard to spot and only result in the special page not finding any tests. This is not a perfect solution but it would have saved me a full day of troubleshooting. Change-Id: I247174f89772b84b4cad31deffb03152921df020 --- diff --git a/includes/specials/SpecialJavaScriptTest.php b/includes/specials/SpecialJavaScriptTest.php index 0e2e7db046..dc6a619750 100644 --- a/includes/specials/SpecialJavaScriptTest.php +++ b/includes/specials/SpecialJavaScriptTest.php @@ -137,7 +137,9 @@ class SpecialJavaScriptTest extends SpecialPage { $code .= '(function () {' . 'var start = window.__karma__ ? window.__karma__.start : QUnit.start;' . 'try {' - . 'mw.loader.using( ' . Xml::encodeJsVar( $modules ) . ' ).always( start );' + . 'mw.loader.using( ' . Xml::encodeJsVar( $modules ) . ' )' + . '.always( start )' + . '.fail( function ( e ) { throw e; } );' . '} catch ( e ) { start(); throw e; }' . '}());';