Skip to content

Commit bcfc1d1

Browse files
BridgeARBethGriggs
authored andcommitted
test: run eslint on test file and fix errors
This removes two entries from the eslint ignore file. One file does not exist anymore and the other one could easily be fixed. PR-URL: #25009 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent 1752798 commit bcfc1d1

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

.eslintignore

-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
node_modules
2-
lib/internal/v8.js
32
lib/internal/v8_prof_polyfill.js
43
lib/punycode.js
54
test/addons/??_*
6-
test/es-module/test-esm-dynamic-import.js
75
test/fixtures
86
test/message/esm_display_syntax_error.mjs
97
tools/icu

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

+10-9
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ targetURL.pathname = absolutePath;
1111

1212
function expectErrorProperty(result, propertyKey, value) {
1313
Promise.resolve(result)
14-
.catch(common.mustCall(error => {
14+
.catch(common.mustCall((error) => {
1515
assert.strictEqual(error[propertyKey], value);
1616
}));
1717
}
@@ -22,15 +22,16 @@ function expectMissingModuleError(result) {
2222

2323
function expectOkNamespace(result) {
2424
Promise.resolve(result)
25-
.then(common.mustCall(ns => {
25+
.then(common.mustCall((ns) => {
2626
// Can't deepStrictEqual because ns isn't a normal object
27+
// eslint-disable-next-line no-restricted-properties
2728
assert.deepEqual(ns, { default: true });
2829
}));
2930
}
3031

3132
function expectFsNamespace(result) {
3233
Promise.resolve(result)
33-
.then(common.mustCall(ns => {
34+
.then(common.mustCall((ns) => {
3435
assert.strictEqual(typeof ns.default.writeFile, 'function');
3536
assert.strictEqual(typeof ns.writeFile, 'function');
3637
}));
@@ -41,19 +42,19 @@ function expectFsNamespace(result) {
4142
(function testScriptOrModuleImport() {
4243
// Importing another file, both direct & via eval
4344
// expectOkNamespace(import(relativePath));
44-
expectOkNamespace(eval.call(null, `import("${relativePath}")`));
4545
expectOkNamespace(eval(`import("${relativePath}")`));
46-
expectOkNamespace(eval.call(null, `import("${targetURL}")`));
46+
expectOkNamespace(eval(`import("${relativePath}")`));
47+
expectOkNamespace(eval(`import("${targetURL}")`));
4748

4849
// Importing a built-in, both direct & via eval
49-
expectFsNamespace(import("fs"));
50+
expectFsNamespace(import('fs'));
51+
expectFsNamespace(eval('import("fs")'));
5052
expectFsNamespace(eval('import("fs")'));
51-
expectFsNamespace(eval.call(null, 'import("fs")'));
5253

53-
expectMissingModuleError(import("./not-an-existing-module.mjs"));
54+
expectMissingModuleError(import('./not-an-existing-module.mjs'));
5455
// TODO(jkrems): Right now this doesn't hit a protocol error because the
5556
// module resolution step already rejects it. These arguably should be
5657
// protocol errors.
57-
expectMissingModuleError(import("node:fs"));
58+
expectMissingModuleError(import('node:fs'));
5859
expectMissingModuleError(import('http://example.com/foo.js'));
5960
})();

0 commit comments

Comments
 (0)