diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-12-08 09:55:49 +0100 |
commit | 4ac9fa081a7c045f6a9f1cfc529d82423f485b2e (patch) | |
tree | af68743f2f4a47d13f2b0eb05f5c4aaf86d8ea37 /tests/qunit/data/testrunner.js | |
parent | af4da56f1ad4d3ef7b06557bae365da2ea27a897 (diff) |
Update to MediaWiki 1.22.0
Diffstat (limited to 'tests/qunit/data/testrunner.js')
-rw-r--r-- | tests/qunit/data/testrunner.js | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/tests/qunit/data/testrunner.js b/tests/qunit/data/testrunner.js index 62dd81ac..1a2bfa10 100644 --- a/tests/qunit/data/testrunner.js +++ b/tests/qunit/data/testrunner.js @@ -38,6 +38,8 @@ tooltip: 'Enable debug mode in ResourceLoader' } ); + QUnit.config.requireExpects = true; + /** * Load TestSwarm agent */ @@ -48,13 +50,14 @@ // 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' ) ) ); } /** * CompletenessTest + * + * Adds toggle checkbox to header */ - // Adds toggle checkbox to header QUnit.config.urlConfig.push( { id: 'completenesstest', label: 'Run CompletenessTest', @@ -93,8 +96,9 @@ /** * Test environment recommended for all QUnit test modules + * + * Whether to log environment changes to the console */ - // Whether to log environment changes to the console QUnit.config.urlConfig.push( 'mwlogenv' ); /** @@ -347,6 +351,25 @@ 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>', |