+ QUnit.test( '.load() - Error: Circular dependency (direct)', function ( assert ) {
+ var capture = [];
+ mw.loader.register( [
+ [ 'test.load.circleDirect', '0', [ 'test.load.circleDirect' ] ]
+ ] );
+ 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.circleDirect' );
+ assert.deepEqual(
+ [ {
+ topic: 'resourceloader.exception',
+ error: 'Circular reference detected: test.load.circleDirect -> test.load.circleDirect',
+ source: 'resolve'
+ } ],
+ capture,
+ 'Detect a direct self-dependency'
+ );
+ } );
+