diff --git a/tests/.eslintrc.json b/tests/.eslintrc.json index d8e4a4e58..9ad47d2d9 100644 --- a/tests/.eslintrc.json +++ b/tests/.eslintrc.json @@ -15,7 +15,6 @@ "new-cap": "warn", "no-undef": "warn", - "no-useless-escape": "warn", - "strict": "warn" + "no-useless-escape": "warn" } } diff --git a/tests/jest.setup.js b/tests/jest.setup.js index a63a116eb..3cb094332 100644 --- a/tests/jest.setup.js +++ b/tests/jest.setup.js @@ -1,3 +1,5 @@ +'use strict'; + // Tweak some mw.configs as needed by tests mw.config.set({ wgPageName: 'Macbeth,_King_of_Scotland', diff --git a/tests/morebits.array.js b/tests/morebits.array.js index c64b9d8a9..b8c29542c 100644 --- a/tests/morebits.array.js +++ b/tests/morebits.array.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.array', () => { test('chunk', () => { assert.deepEqual(Morebits.array.chunk([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 3), [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10]], '10 over 3'); diff --git a/tests/morebits.batchOperation.js b/tests/morebits.batchOperation.js index 76bab9616..06aed974a 100644 --- a/tests/morebits.batchOperation.js +++ b/tests/morebits.batchOperation.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.batchOperation', () => { test('Contruction', () => { assert.true(new Morebits.batchOperation() instanceof Morebits.batchOperation, 'Correct instance'); diff --git a/tests/morebits.createHtml.js b/tests/morebits.createHtml.js index 63563c9e4..07be8fe88 100644 --- a/tests/morebits.createHtml.js +++ b/tests/morebits.createHtml.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.createHtml', () => { test('createHtml', () => { diff --git a/tests/morebits.date.js b/tests/morebits.date.js index 9327c471a..b9d535948 100644 --- a/tests/morebits.date.js +++ b/tests/morebits.date.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.date', () => { const now = Date.now(); const timestampMediaWiki = '16:26, 7 November 2020 (UTC)', timestampIso = '2020-11-07T16:26:00.000Z', naive = 20201107162600; diff --git a/tests/morebits.ip.js b/tests/morebits.ip.js index 06e5b5516..d4f2da800 100644 --- a/tests/morebits.ip.js +++ b/tests/morebits.ip.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.ip', () => { test('sanitizeIPv6', () => { assert.strictEqual(Morebits.ip.sanitizeIPv6('2001:0db8:0010:0000:0000:0000:0000:0001'), '2001:DB8:10:0:0:0:0:1', 'Shorten IPv6'); diff --git a/tests/morebits.js b/tests/morebits.js index 741eb212a..13083740c 100644 --- a/tests/morebits.js +++ b/tests/morebits.js @@ -1,3 +1,5 @@ +'use strict'; + describe('constants', () => { test('userIsSysop', () => { assert.true(Morebits.userIsSysop, 'Is sysop'); diff --git a/tests/morebits.quickForm.js b/tests/morebits.quickForm.js index 964aa59dd..de48acb10 100644 --- a/tests/morebits.quickForm.js +++ b/tests/morebits.quickForm.js @@ -1,3 +1,5 @@ +'use strict'; + /** * Simple helper to render a quickform element * diff --git a/tests/morebits.string.js b/tests/morebits.string.js index cdedfc1f0..bce71c9b9 100644 --- a/tests/morebits.string.js +++ b/tests/morebits.string.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.string', () => { test('escapeRegExp', () => { assert.strictEqual(Morebits.string.escapeRegExp('Four score and seven years ago'), 'Four[_ ]score[_ ]and[_ ]seven[_ ]years[_ ]ago', 'Spaces'); diff --git a/tests/morebits.taskManager.js b/tests/morebits.taskManager.js index b44ad04fc..7d5ea5f00 100644 --- a/tests/morebits.taskManager.js +++ b/tests/morebits.taskManager.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.taskManager', () => { test('Contruction', () => { const tm = new Morebits.taskManager(); diff --git a/tests/morebits.unbinder.js b/tests/morebits.unbinder.js index 2540f457c..98e7362ec 100644 --- a/tests/morebits.unbinder.js +++ b/tests/morebits.unbinder.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.unbinder', () => { test('Construction', () => { assert.throws(() => new Morebits.unbinder(), 'throws: no string'); diff --git a/tests/morebits.wikitext.js b/tests/morebits.wikitext.js index 2bf15abd0..6d7a8b5e1 100644 --- a/tests/morebits.wikitext.js +++ b/tests/morebits.wikitext.js @@ -1,3 +1,5 @@ +'use strict'; + describe('Morebits.wikitext', () => { test('parseTemplate', () => { // Function to help build a template from a sample object diff --git a/tests/twinkleblock.test.js b/tests/twinkleblock.test.js index 732af83da..83ffe60bb 100644 --- a/tests/twinkleblock.test.js +++ b/tests/twinkleblock.test.js @@ -1,3 +1,5 @@ +'use strict'; + describe('modules/twinkleblock', () => { describe('combineFormDataAndFieldTemplateOptions', () => { // https://github.com/wikimedia-gadgets/twinkle/issues/2106 diff --git a/tests/twinkletag.test.js b/tests/twinkletag.test.js index dc9586b0d..eeb228d24 100644 --- a/tests/twinkletag.test.js +++ b/tests/twinkletag.test.js @@ -1,3 +1,5 @@ +'use strict'; + describe('modules/twinkletag', () => { describe('checkIncompatible', () => { test('no conflicts, 0 tags to check', () => { diff --git a/tests/twinklewarn.test.js b/tests/twinklewarn.test.js index 3684775a1..5e054df2c 100644 --- a/tests/twinklewarn.test.js +++ b/tests/twinklewarn.test.js @@ -1,3 +1,5 @@ +'use strict'; + describe('modules/twinklewarn', () => { describe('getTemplateProperty', () => { const templates = { diff --git a/tests/twinklexfd.test.js b/tests/twinklexfd.test.js index 0fd9812bb..c895b249d 100644 --- a/tests/twinklexfd.test.js +++ b/tests/twinklexfd.test.js @@ -1,3 +1,5 @@ +'use strict'; + describe('modules/twinklexfd', () => { describe('insertRMTR', () => { test('0 rows, 1 line breaks', () => {