+ QUnit.test( '.load() - Error: Unregistered', function ( assert ) {
+ var capture = [];
+ this.sandbox.stub( mw, 'track', function ( topic, data ) {
+ capture.push( {
+ topic: topic,
+ error: data.exception && data.exception.message,
+ source: data.source
+ } );
+ } );
+
+ mw.loader.load( 'test.load.unreg' );
+ assert.deepEqual(
+ [ {
+ topic: 'resourceloader.exception',
+ error: 'Unknown dependency: test.load.unreg',
+ source: 'resolve'
+ } ],
+ capture
+ );
+ } );
+
+ // Regression test for T36853
+ QUnit.test( '.load() - Error: Missing dependency', function ( assert ) {
+ var capture = [];
+ this.sandbox.stub( mw, 'track', function ( topic, data ) {
+ capture.push( {
+ topic: topic,
+ error: data.exception && data.exception.message,
+ source: data.source
+ } );
+ } );
+
+ mw.loader.register( [
+ [ 'test.load.missingdep1', '0', [ 'test.load.missingdep2' ] ],
+ [ 'test.load.missingdep', '0', [ 'test.load.missingdep1' ] ]
+ ] );
+ mw.loader.load( 'test.load.missingdep' );
+ assert.deepEqual(
+ [ {
+ topic: 'resourceloader.exception',
+ error: 'Unknown dependency: test.load.missingdep2',
+ source: 'resolve'
+ } ],
+ capture
+ );