Fix ULS QUnit tests

Tests were failing for two reasons: wrong modules as dependencies of the
test module and test timing out due to incorrect usage of QUnit.asyncTest
and QUnit.start() and QUnit.Stop.

While at it, did some small cleanups and converted the number of
assertions to use non-deprecated QUnit.expect() instead.

Options are saved using postWithToken of mw.API. This also rises minimum
MediaWiki version to 1.22. This allowed removing hundred lines of code.
MLEB is already 1.22 and above.

Change-Id: I46a1674e4ede48a0e331c8d201d1d847db51d9dd
This commit is contained in:
Niklas Laxström
2014-09-18 12:27:06 +02:00
committed by Santhosh
parent c5bca60536
commit d25f7f3307
3 changed files with 35 additions and 100 deletions

View File

@@ -102,7 +102,7 @@ class UniversalLanguageSelectorHooks {
public static function addTestModules( array &$testModules, ResourceLoader &$resourceLoader ) {
$testModules['qunit']['ext.uls.tests'] = array(
'scripts' => array( 'tests/qunit/ext.uls.tests.js' ),
'dependencies' => array( 'ext.uls.init', 'ext.uls.interface' ),
'dependencies' => array( 'jquery.uls', 'ext.uls.preferences' ),
'localBasePath' => __DIR__,
'remoteExtPath' => 'UniversalLanguageSelector',
);