jenkins-bot has submitted this change and it was merged.

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, 11 insertions(+), 25 deletions(-)

Approvals:
  Santhosh: Verified; Looks good to me, approved
  jenkins-bot: Verified



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..ffb6974 100644
--- a/tests/qunit/ext.uls.tests.js
+++ b/tests/qunit/ext.uls.tests.js
@@ -20,25 +20,20 @@
 ( function ( $, mw ) {
        '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,14 +50,14 @@
                };
 
                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 );

-- 
To view, visit https://gerrit.wikimedia.org/r/64566
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id56aa9c742bdd5dd7cec5848d1b44a4dafaca9c0
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Nikerabbit <[email protected]>
Gerrit-Reviewer: Santhosh <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to