qunit: Use jQuery.getScript instead of document.write
authorTimo Tijhof <krinklemail@gmail.com>
Mon, 6 May 2013 18:55:04 +0000 (20:55 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 7 May 2013 01:36:19 +0000 (01:36 +0000)
TestSwarm jobs were breaking because this runs after the
document is ready, thus causing the page to be blanked by
document.write.

Change-Id: I5e1c331d72ac364c9cd970a9b085f0b986b26a14

tests/qunit/data/testrunner.js

index 3f3c899..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' ) ) );
        }
 
        /**