Merge "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action""
[lhc/web/wiklou.git] / tests / qunit / data / testrunner.js
index 9074aba..743660a 100644 (file)
@@ -1,5 +1,5 @@
 /* global sinon */
-( function ( $, mw, QUnit ) {
+( function () {
        'use strict';
 
        var addons, nested;
                                // Check for incomplete animations/requests/etc and throw if there are any.
                                if ( $.timers && $.timers.length !== 0 ) {
                                        timers = $.timers.length;
+                                       // eslint-disable-next-line jquery/no-each-util
                                        $.each( $.timers, function ( i, timer ) {
                                                var node = timer.elem;
                                                mw.log.warn( 'Unfinished animation #' + i + ' in ' + timer.queue + ' queue on ' +
        QUnit.whenPromisesComplete = function () {
                var altPromises = [];
 
+               // When we have ES6 support we'll be able to use Array.from here
+               // eslint-disable-next-line jquery/no-each-util
                $.each( arguments, function ( i, arg ) {
                        var alt = $.Deferred();
                        altPromises.push( alt );
        } ) );
 
        QUnit.test( 'Setup', function ( assert ) {
-               assert.equal( mw.html.escape( 'foo' ), 'mocked', 'setup() callback was ran.' );
-               assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object applied' );
-               assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' );
+               assert.strictEqual( mw.html.escape( 'foo' ), 'mocked', 'setup() callback was ran.' );
+               assert.strictEqual( mw.config.get( 'testVar' ), 'foo', 'config object applied' );
+               assert.strictEqual( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object applied' );
 
                mw.config.set( 'testVar', 'bar' );
                mw.messages.set( 'testMsg', 'Bar.' );
        } );
 
        QUnit.test( 'Teardown', function ( assert ) {
-               assert.equal( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' );
-               assert.equal( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' );
+               assert.strictEqual( mw.config.get( 'testVar' ), 'foo', 'config object restored and re-applied after test()' );
+               assert.strictEqual( mw.messages.get( 'testMsg' ), 'Foo.', 'messages object restored and re-applied after test()' );
        } );
 
        QUnit.test( 'Loader status', function ( assert ) {
        QUnit.module( 'testrunner-after', QUnit.newMwEnvironment() );
 
        QUnit.test( 'Teardown', function ( assert ) {
-               assert.equal( mw.html.escape( '<' ), '&lt;', 'teardown() callback was ran.' );
-               assert.equal( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' );
-               assert.equal( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' );
+               assert.strictEqual( mw.html.escape( '<' ), '&lt;', 'teardown() callback was ran.' );
+               assert.strictEqual( mw.config.get( 'testVar' ), null, 'config object restored to live in next module()' );
+               assert.strictEqual( mw.messages.get( 'testMsg' ), null, 'messages object restored to live in next module()' );
        } );
 
        QUnit.module( 'testrunner-each', {
                mw.html = null;
        } );
        QUnit.test( 'afterEach', function ( assert ) {
-               assert.equal( mw.html.escape( '<' ), '&lt;', 'afterEach() ran' );
+               assert.strictEqual( mw.html.escape( '<' ), '&lt;', 'afterEach() ran' );
        } );
 
        QUnit.module( 'testrunner-each-compat', {
                mw.html = null;
        } );
        QUnit.test( 'teardown', function ( assert ) {
-               assert.equal( mw.html.escape( '<' ), '&lt;', 'teardown() ran' );
+               assert.strictEqual( mw.html.escape( '<' ), '&lt;', 'teardown() ran' );
        } );
 
        // Regression test for 'this.sandbox undefined' error, fixed by
                } );
        } );
 
-}( jQuery, mediaWiki, QUnit ) );
+}() );