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
$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; }'
. '}());';