From a976cee0e498813ba1fe264497d0d0eb9f290c4f Mon Sep 17 00:00:00 2001 From: Stephane Bisson Date: Tue, 31 Jan 2017 11:21:00 -0500 Subject: [PATCH] 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 --- includes/specials/SpecialJavaScriptTest.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }' . '}());'; -- 2.20.1