Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 41adb54

Browse filesBrowse files
committed
tools: enforce trailing commas in test/es-module
PR-URL: #60891 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
1 parent eebd732 commit 41adb54
Copy full SHA for 41adb54

40 files changed

+88-88Lines changed: 88 additions & 88 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/es-module/test-disable-require-module-with-detection.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-disable-require-module-with-detection.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ assert.throws(
1515
() => require('../fixtures/es-modules/loose.js'),
1616
{
1717
name: 'SyntaxError',
18-
message: /Unexpected token 'export'/
18+
message: /Unexpected token 'export'/,
1919
});
Collapse file

‎test/es-module/test-dynamic-import-script-lifetime.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-dynamic-import-script-lifetime.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ vm.runInThisContext(code, {
2828
await m.link(() => {});
2929
await m.evaluate();
3030
return m;
31-
}
31+
},
3232
});
Collapse file

‎test/es-module/test-esm-cjs-named-error.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-cjs-named-error.mjs
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,21 @@ await assert.rejects(async () => {
2727
await import(`${fixtureBase}/single-quote.mjs`);
2828
}, {
2929
name: 'SyntaxError',
30-
message: expectedRelative
30+
message: expectedRelative,
3131
}, 'should support relative specifiers with single quotes');
3232

3333
await assert.rejects(async () => {
3434
await import(`${fixtureBase}/double-quote.mjs`);
3535
}, {
3636
name: 'SyntaxError',
37-
message: expectedRelative
37+
message: expectedRelative,
3838
}, 'should support relative specifiers with double quotes');
3939

4040
await assert.rejects(async () => {
4141
await import(`${fixtureBase}/renamed-import.mjs`);
4242
}, {
4343
name: 'SyntaxError',
44-
message: expectedRenamed
44+
message: expectedRenamed,
4545
}, 'should correctly format named imports with renames');
4646

4747
await assert.rejects(async () => {
@@ -55,21 +55,21 @@ await assert.rejects(async () => {
5555
await import(`${fixtureBase}/json-hack.mjs`);
5656
}, {
5757
name: 'SyntaxError',
58-
message: expectedPackageHack
58+
message: expectedPackageHack,
5959
}, 'should respect recursive package.json for module type');
6060

6161
await assert.rejects(async () => {
6262
await import(`${fixtureBase}/bare-import-single.mjs`);
6363
}, {
6464
name: 'SyntaxError',
65-
message: expectedBare
65+
message: expectedBare,
6666
}, 'should support bare specifiers with single quotes');
6767

6868
await assert.rejects(async () => {
6969
await import(`${fixtureBase}/bare-import-double.mjs`);
7070
}, {
7171
name: 'SyntaxError',
72-
message: expectedBare
72+
message: expectedBare,
7373
}, 'should support bare specifiers with double quotes');
7474

7575
await assert.rejects(async () => {
Collapse file

‎test/es-module/test-esm-data-urls.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-data-urls.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function createBase64URL(mime, body) {
7676
import('data:application/json;foo="test,",0',
7777
{ with: { type: 'json' } }), {
7878
name: 'SyntaxError',
79-
message: /Unterminated string in JSON at position 3/
79+
message: /Unterminated string in JSON at position 3/,
8080
});
8181
}
8282
{
Collapse file

‎test/es-module/test-esm-dns-promises.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-dns-promises.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ assert.throws(() => {
1010
}, {
1111
code: 'ERR_INVALID_ARG_VALUE',
1212
name: 'TypeError',
13-
message: `The argument 'address' is invalid. Received '${invalidAddress}'`
13+
message: `The argument 'address' is invalid. Received '${invalidAddress}'`,
1414
});
Collapse file

‎test/es-module/test-esm-dynamic-import.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-dynamic-import.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function expectOkNamespace(result) {
1919
.then(common.mustCall((ns) => {
2020
const expected = { default: true };
2121
Object.defineProperty(expected, Symbol.toStringTag, {
22-
value: 'Module'
22+
value: 'Module',
2323
});
2424
Object.setPrototypeOf(expected, Object.getPrototypeOf(ns));
2525
assert.deepStrictEqual(ns, expected);
Collapse file

‎test/es-module/test-esm-import-meta.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-import-meta.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ for (const descriptor of Object.values(descriptors)) {
1212
assert.deepStrictEqual(descriptor, {
1313
enumerable: true,
1414
writable: true,
15-
configurable: true
15+
configurable: true,
1616
});
1717
}
1818

Collapse file

‎test/es-module/test-esm-loader-invalid-format.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-invalid-format.mjs
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ import assert from 'assert';
55
import('../fixtures/es-modules/test-esm-ok.mjs')
66
.then(assert.fail, expectsError({
77
code: 'ERR_UNKNOWN_MODULE_FORMAT',
8-
message: /Unknown module format: esm/
8+
message: /Unknown module format: esm/,
99
}))
1010
.then(mustCall());
Collapse file

‎test/es-module/test-esm-loader-mock.mjs‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-mock.mjs
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,21 @@ import assert from 'node:assert/strict';
33
import { mock } from '../fixtures/es-module-loaders/mock.mjs';
44

55
mock('node:events', {
6-
EventEmitter: 'This is mocked!'
6+
EventEmitter: 'This is mocked!',
77
});
88

99
// This resolves to node:events
1010
// It is intercepted by mock-loader and doesn't return the normal value
1111
assert.deepStrictEqual(await import('events'), Object.defineProperty({
1212
__proto__: null,
13-
EventEmitter: 'This is mocked!'
13+
EventEmitter: 'This is mocked!',
1414
}, Symbol.toStringTag, {
1515
enumerable: false,
16-
value: 'Module'
16+
value: 'Module',
1717
}));
1818

1919
const mutator = mock('node:events', {
20-
EventEmitter: 'This is mocked v2!'
20+
EventEmitter: 'This is mocked v2!',
2121
});
2222

2323
// It is intercepted by mock-loader and doesn't return the normal value.
@@ -26,17 +26,17 @@ const mutator = mock('node:events', {
2626
const mockedV2 = await import('node:events');
2727
assert.deepStrictEqual(mockedV2, Object.defineProperty({
2828
__proto__: null,
29-
EventEmitter: 'This is mocked v2!'
29+
EventEmitter: 'This is mocked v2!',
3030
}, Symbol.toStringTag, {
3131
enumerable: false,
32-
value: 'Module'
32+
value: 'Module',
3333
}));
3434

3535
mutator.EventEmitter = 'This is mocked v3!';
3636
assert.deepStrictEqual(mockedV2, Object.defineProperty({
3737
__proto__: null,
38-
EventEmitter: 'This is mocked v3!'
38+
EventEmitter: 'This is mocked v3!',
3939
}, Symbol.toStringTag, {
4040
enumerable: false,
41-
value: 'Module'
41+
value: 'Module',
4242
}));
Collapse file

‎test/es-module/test-esm-loader-modulemap.js‎

Copy file name to clipboardExpand all lines: test/es-module/test-esm-loader-modulemap.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl,
5555
const errorObj = {
5656
code: 'ERR_INVALID_ARG_TYPE',
5757
name: 'TypeError',
58-
message: /^The "url" argument must be of type string/
58+
message: /^The "url" argument must be of type string/,
5959
};
6060

6161
[{}, [], true, 1].forEach((value) => {
@@ -73,7 +73,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl,
7373
const errorObj = {
7474
code: 'ERR_INVALID_ARG_TYPE',
7575
name: 'TypeError',
76-
message: /^The "type" argument must be of type string/
76+
message: /^The "type" argument must be of type string/,
7777
};
7878

7979
[{}, [], true, 1].forEach((value) => {
@@ -91,7 +91,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl,
9191
assert.throws(() => moduleMap.set('', undefined, value), {
9292
code: 'ERR_INVALID_ARG_TYPE',
9393
name: 'TypeError',
94-
message: /^The "job" argument must be an instance of ModuleJob/
94+
message: /^The "job" argument must be an instance of ModuleJob/,
9595
});
9696
});
9797
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.