File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change 1
1
// Flags: --experimental-vm-modules
2
- 'use strict' ;
3
- const common = require ( '../common' ) ;
4
-
5
- const assert = require ( 'assert' ) ;
6
- const { Script, SourceTextModule, createContext } = require ( 'vm' ) ;
2
+ import * as common from '../common/index.mjs' ;
3
+ import assert from 'node:assert' ;
4
+ import { Script , SourceTextModule , createContext } from 'node:vm' ;
7
5
8
6
async function test ( ) {
9
7
const foo = new SourceTextModule ( 'export const a = 1;' ) ;
@@ -23,7 +21,7 @@ async function test() {
23
21
} ) ;
24
22
25
23
const result = s . runInContext ( ctx ) ;
26
- assert . strictEqual ( foo . namespace , await result ) ;
24
+ assert . strictEqual ( await result , foo . namespace ) ;
27
25
}
28
26
29
27
{
@@ -33,7 +31,7 @@ async function test() {
33
31
} ) ;
34
32
await m . link ( common . mustNotCall ( ) ) ;
35
33
await m . evaluate ( ) ;
36
- assert . strictEqual ( foo . namespace , await ctx . fooResult ) ;
34
+ assert . strictEqual ( await ctx . fooResult , foo . namespace ) ;
37
35
delete ctx . fooResult ;
38
36
}
39
37
}
@@ -66,7 +64,5 @@ async function testMissing() {
66
64
}
67
65
}
68
66
69
- ( async function ( ) {
70
- await test ( ) ;
71
- await testMissing ( ) ;
72
- } ( ) ) . then ( common . mustCall ( ) ) ;
67
+ await test ( ) ;
68
+ await testMissing ( ) ;
You can’t perform that action at this time.
0 commit comments