@@ -23,7 +23,7 @@ test('test config is without transform', () => {
2323// The versions where vm.Module exists and commonjs with "exports" is not broken
2424onNodeVersions ( '^12.16.0 || >=13.7.0' , ( ) => {
2525 test ( 'runs test with native ESM' , ( ) => {
26- const { exitCode, stderr, stdout} = runJest ( DIR , [ ] , {
26+ const { exitCode, stderr, stdout} = runJest ( DIR , [ 'native-esm.test.js' ] , {
2727 nodeOptions : '--experimental-vm-modules' ,
2828 } ) ;
2929
@@ -34,3 +34,20 @@ onNodeVersions('^12.16.0 || >=13.7.0', () => {
3434 expect ( exitCode ) . toBe ( 0 ) ;
3535 } ) ;
3636} ) ;
37+
38+ // The versions where TLA is supported
39+ onNodeVersions ( '>=14.3.0' , ( ) => {
40+ test ( 'supports top-level await' , ( ) => {
41+ const { exitCode, stderr, stdout} = runJest (
42+ DIR ,
43+ [ 'native-esm.tla.test.js' ] ,
44+ { nodeOptions : '--experimental-vm-modules' } ,
45+ ) ;
46+
47+ const { summary} = extractSummary ( stderr ) ;
48+
49+ expect ( wrap ( summary ) ) . toMatchSnapshot ( ) ;
50+ expect ( stdout ) . toBe ( '' ) ;
51+ expect ( exitCode ) . toBe ( 0 ) ;
52+ } ) ;
53+ } ) ;
0 commit comments