Skip to content

Commit

Permalink
eslint: fix strict in tests (#2128)
Browse files Browse the repository at this point in the history
* eslint: fix `strict` in tests

manual fixes

* forgot a file

* remove comma
  • Loading branch information
NovemLinguae authored Dec 13, 2024
1 parent 6812d90 commit c2874ba
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 2 deletions.
3 changes: 1 addition & 2 deletions tests/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

"new-cap": "warn",
"no-undef": "warn",
"no-useless-escape": "warn",
"strict": "warn"
"no-useless-escape": "warn"
}
}
2 changes: 2 additions & 0 deletions tests/jest.setup.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

// Tweak some mw.configs as needed by tests
mw.config.set({
wgPageName: 'Macbeth,_King_of_Scotland',
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.array.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.batchOperation.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('Morebits.batchOperation', () => {
test('Contruction', () => {
assert.true(new Morebits.batchOperation() instanceof Morebits.batchOperation, 'Correct instance');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.createHtml.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('Morebits.createHtml', () => {

test('createHtml', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.date.js
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.ip.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('constants', () => {
test('userIsSysop', () => {
assert.true(Morebits.userIsSysop, 'Is sysop');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.quickForm.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

/**
* Simple helper to render a quickform element
*
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.string.js
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.taskManager.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('Morebits.taskManager', () => {
test('Contruction', () => {
const tm = new Morebits.taskManager();
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.unbinder.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('Morebits.unbinder', () => {
test('Construction', () => {
assert.throws(() => new Morebits.unbinder(), 'throws: no string');
Expand Down
2 changes: 2 additions & 0 deletions tests/morebits.wikitext.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('Morebits.wikitext', () => {
test('parseTemplate', () => {
// Function to help build a template from a sample object
Expand Down
2 changes: 2 additions & 0 deletions tests/twinkleblock.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('modules/twinkleblock', () => {
describe('combineFormDataAndFieldTemplateOptions', () => {
// https://github.com/wikimedia-gadgets/twinkle/issues/2106
Expand Down
2 changes: 2 additions & 0 deletions tests/twinkletag.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('modules/twinkletag', () => {
describe('checkIncompatible', () => {
test('no conflicts, 0 tags to check', () => {
Expand Down
2 changes: 2 additions & 0 deletions tests/twinklewarn.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('modules/twinklewarn', () => {
describe('getTemplateProperty', () => {
const templates = {
Expand Down
2 changes: 2 additions & 0 deletions tests/twinklexfd.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'use strict';

describe('modules/twinklexfd', () => {
describe('insertRMTR', () => {
test('0 rows, 1 line breaks', () => {
Expand Down

0 comments on commit c2874ba

Please sign in to comment.