If the jQuery promise returned by mw.loader.using() is rejected
synchronously (e.g. because one of the modules has a dependency on
non-existent module), the function passed to fail() also executes
synchronously. Note that this is true also with jQuery 3.
The exception it throws was caught by the catch() below, which
resulted in start() being called twice, which resulted in QUnit
throwing 'Uncaught Error: Called start() outside of a test
context too many times' rather than actually starting.
Change-Id: I5c6b50647c0af0fdec6547aaa59165f6b4a42642
.always( function () {
start();
} )
- .fail( function ( e ) { throw e; } );
+ .fail( function ( e ) {
+ setTimeout( function () {
+ throw e;
+ } );
+ } );
} catch ( e ) {
start();
throw e;