Nikerabbit has uploaded a new change for review.
https://gerrit.wikimedia.org/r/64566
Change subject: Better way to fix jslint warnings
......................................................................
Better way to fix jslint warnings
Change-Id: Id56aa9c742bdd5dd7cec5848d1b44a4dafaca9c0
---
M .jshintrc
M tests/qunit/ext.uls.tests.js
2 files changed, 13 insertions(+), 27 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector
refs/changes/66/64566/1
diff --git a/.jshintrc b/.jshintrc
index e8ce16e..b6a0f58 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -35,15 +35,6 @@
"predef": [
"mediaWiki",
"jQuery",
-
- /* Qunit specific rules */
- "QUnit",
- "module",
- "expect",
- "start",
- "stop",
- "ok",
- "test",
- "strictEqual"
+ "QUnit"
]
}
diff --git a/tests/qunit/ext.uls.tests.js b/tests/qunit/ext.uls.tests.js
index 6257222..aac5049 100644
--- a/tests/qunit/ext.uls.tests.js
+++ b/tests/qunit/ext.uls.tests.js
@@ -17,28 +17,23 @@
* @licence MIT License
*/
-( function ( $, mw ) {
+( function ( $ ) {
'use strict';
- module( 'ext.uls', QUnit.newMwEnvironment() );
+ QUnit.module( 'ext.uls', QUnit.newMwEnvironment() );
- test( '-- Initial check', function () {
- expect( 1 );
- ok( $.fn.uls, '$.fn.uls is defined' );
+ QUnit.test( '-- Initial check', 1, function ( assert ) {
+ assert.ok( $.fn.uls, '$.fn.uls is defined' );
} );
- test( '-- Custom langdb', function () {
- expect( 1 );
-
+ QUnit.test( '-- Custom langdb', 1, function ( assert ) {
// This is a custom non-standard language code used in MW.
// If it's not defined, then, for example,
// its direction cannot be acquired using the langdb utils.
- strictEqual( $.uls.data.getDir( 'als' ), 'ltr', 'The direction
of custom MW language als is ltr.' );
+ assert.strictEqual( $.uls.data.getDir( 'als' ), 'ltr', 'The
direction of custom MW language als is ltr.' );
} );
- test( '-- User preferences', function () {
- expect( 2 );
-
+ QUnit.asyncTest( '-- User preferences', 2, function ( assert ) {
// 'gofanim' means "fonts" in Hebrew.
// Here it's used as a meaningless word, to test
// the preferences without changing anything useful.
@@ -55,17 +50,17 @@
};
prefs.set( prefName, prefsToSave );
- stop();
+ QUnit.stop();
prefs.save( function ( successSave ) {
- start();
- ok( successSave, 'Options saving API did not produce an
error.' );
+ QUnit.start();
+ assert.ok( successSave, 'Options saving API did not
produce an error.' );
} );
readPrefs = prefs.get( prefName );
- strictEqual( readPrefs[prefName].fonts.qqy, 'Megafont',
'Correct value for the font name' );
+ assert.strictEqual( readPrefs[prefName].fonts.qqy, 'Megafont',
'Correct value for the font name' );
// Delete old options
prefs.set( prefName, undefined );
prefs.save();
} );
-}( jQuery, mediaWiki ) );
+}( jQuery ) );
--
To view, visit https://gerrit.wikimedia.org/r/64566
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id56aa9c742bdd5dd7cec5848d1b44a4dafaca9c0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits