File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change 11// 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' ;
75
86async function test ( ) {
97 const foo = new SourceTextModule ( 'export const a = 1;' ) ;
@@ -23,7 +21,7 @@ async function test() {
2321 } ) ;
2422
2523 const result = s . runInContext ( ctx ) ;
26- assert . strictEqual ( foo . namespace , await result ) ;
24+ assert . strictEqual ( await result , foo . namespace ) ;
2725 }
2826
2927 {
@@ -33,7 +31,7 @@ async function test() {
3331 } ) ;
3432 await m . link ( common . mustNotCall ( ) ) ;
3533 await m . evaluate ( ) ;
36- assert . strictEqual ( foo . namespace , await ctx . fooResult ) ;
34+ assert . strictEqual ( await ctx . fooResult , foo . namespace ) ;
3735 delete ctx . fooResult ;
3836 }
3937}
@@ -66,7 +64,7 @@ async function testMissing() {
6664 }
6765}
6866
69- ( async function ( ) {
70- await test ( ) ;
71- await testMissing ( ) ;
72- } ( ) ) . then ( common . mustCall ( ) ) ;
67+ await Promise . all ( [
68+ test ( ) ,
69+ testMissing ( ) ,
70+ ] ) . then ( common . mustCall ( ) ) ;
You can’t perform that action at this time.
0 commit comments