@@ -11,7 +11,7 @@ targetURL.pathname = absolutePath;
11
11
12
12
function expectErrorProperty ( result , propertyKey , value ) {
13
13
Promise . resolve ( result )
14
- . catch ( common . mustCall ( error => {
14
+ . catch ( common . mustCall ( ( error ) => {
15
15
assert . strictEqual ( error [ propertyKey ] , value ) ;
16
16
} ) ) ;
17
17
}
@@ -22,15 +22,16 @@ function expectMissingModuleError(result) {
22
22
23
23
function expectOkNamespace ( result ) {
24
24
Promise . resolve ( result )
25
- . then ( common . mustCall ( ns => {
25
+ . then ( common . mustCall ( ( ns ) => {
26
26
// Can't deepStrictEqual because ns isn't a normal object
27
+ // eslint-disable-next-line no-restricted-properties
27
28
assert . deepEqual ( ns , { default : true } ) ;
28
29
} ) ) ;
29
30
}
30
31
31
32
function expectFsNamespace ( result ) {
32
33
Promise . resolve ( result )
33
- . then ( common . mustCall ( ns => {
34
+ . then ( common . mustCall ( ( ns ) => {
34
35
assert . strictEqual ( typeof ns . default . writeFile , 'function' ) ;
35
36
assert . strictEqual ( typeof ns . writeFile , 'function' ) ;
36
37
} ) ) ;
@@ -41,19 +42,19 @@ function expectFsNamespace(result) {
41
42
( function testScriptOrModuleImport ( ) {
42
43
// Importing another file, both direct & via eval
43
44
// expectOkNamespace(import(relativePath));
44
- expectOkNamespace ( eval . call ( null , `import("${ relativePath } ")` ) ) ;
45
45
expectOkNamespace ( eval ( `import("${ relativePath } ")` ) ) ;
46
- expectOkNamespace ( eval . call ( null , `import("${ targetURL } ")` ) ) ;
46
+ expectOkNamespace ( eval ( `import("${ relativePath } ")` ) ) ;
47
+ expectOkNamespace ( eval ( `import("${ targetURL } ")` ) ) ;
47
48
48
49
// Importing a built-in, both direct & via eval
49
- expectFsNamespace ( import ( "fs" ) ) ;
50
+ expectFsNamespace ( import ( 'fs' ) ) ;
51
+ expectFsNamespace ( eval ( 'import("fs")' ) ) ;
50
52
expectFsNamespace ( eval ( 'import("fs")' ) ) ;
51
- expectFsNamespace ( eval . call ( null , 'import("fs")' ) ) ;
52
53
53
- expectMissingModuleError ( import ( " ./not-an-existing-module.mjs" ) ) ;
54
+ expectMissingModuleError ( import ( ' ./not-an-existing-module.mjs' ) ) ;
54
55
// TODO(jkrems): Right now this doesn't hit a protocol error because the
55
56
// module resolution step already rejects it. These arguably should be
56
57
// protocol errors.
57
- expectMissingModuleError ( import ( " node:fs" ) ) ;
58
+ expectMissingModuleError ( import ( ' node:fs' ) ) ;
58
59
expectMissingModuleError ( import ( 'http://example.com/foo.js' ) ) ;
59
60
} ) ( ) ;
0 commit comments