Merge "(bug 46751) Make Buryat (Russia) (буряад) (bxr) fallback to Russian"
[lhc/web/wiklou.git] / tests / qunit / data / testrunner.js
index a6f729b..1a2bfa1 100644 (file)
@@ -50,7 +50,7 @@
        // of MediaWiki has actually been configured with the required url to that inject.js
        // script. By default it is false.
        if ( QUnit.urlParams.swarmURL && mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) {
-               document.write( '<scr' + 'ipt src="' + QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) + '"></scr' + 'ipt>' );
+               jQuery.getScript( QUnit.fixurl( mw.config.get( 'QUnitTestSwarmInjectJSPath' ) ) );
        }
 
        /**
                assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' );
        } );
 
+       QUnit.test( 'Loader status', 2, function ( assert ) {
+               var i, len, state,
+                       modules = mw.loader.getModuleNames(),
+                       error = [],
+                       missing = [];
+
+               for ( i = 0, len = modules.length; i < len; i++ ) {
+                       state = mw.loader.getState( modules[i] );
+                       if ( state === 'error' ) {
+                               error.push( modules[i] );
+                       } else if ( state === 'missing' ) {
+                               missing.push( modules[i] );
+                       }
+               }
+
+               assert.deepEqual( error, [], 'Modules in error state' );
+               assert.deepEqual( missing, [], 'Modules in missing state' );
+       } );
+
        QUnit.test( 'htmlEqual', 8, function ( assert ) {
                assert.htmlEqual(
                        '<div><p class="some classes" data-length="10">Child paragraph with <a href="http://example.com">A link</a></p>Regular text<span>A span</span></div>',