Merge "resources: Strip '$' and 'mw' from file closures"
[lhc/web/wiklou.git] / tests / qunit / data / testrunner.js
index 06c146c..be8b3a9 100644 (file)
@@ -1,5 +1,5 @@
 /* global sinon */
-( function ( $, mw, QUnit ) {
+( function () {
        'use strict';
 
        var addons, nested;
@@ -40,7 +40,7 @@
         * Configuration
         */
 
-       // For each test() that is asynchronous, allow this time to pass before
+       // For each test that is asynchronous, allow this time to pass before
        // killing the test and assuming timeout failure.
        QUnit.config.testTimeout = 60 * 1000;
 
        }() );
 
        /**
-        * Reset mw.config and others to a fresh copy of the live config for each test(),
+        * Reset mw.config and others to a fresh copy of the live config for each test,
         * and restore it back to the live one afterwards.
         *
         * @param {Object} [localEnv]
                                // Check for incomplete animations/requests/etc and throw if there are any.
                                if ( $.timers && $.timers.length !== 0 ) {
                                        timers = $.timers.length;
+                                       // eslint-disable-next-line no-restricted-properties
                                        $.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 no-restricted-properties
                $.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', {
+               // eslint-disable-next-line qunit/no-setup-teardown
                setup: function () {
                        this.mwHtmlLive = mw.html;
                },
+               // eslint-disable-next-line qunit/no-setup-teardown
                teardown: function () {
                        mw.html = this.mwHtmlLive;
                }
                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 ) );
+}() );