@@ -4,70 +4,72 @@ import * as fixtures from '../common/fixtures.mjs';
44import { describe , it } from 'node:test' ;
55import { strictEqual } from 'node:assert' ;
66
7- describe ( 'the type flag should change the interpretation of certain files outside of any package scope' , { concurrency : true } , ( ) => {
8- it ( 'should run as ESM a .js file that is outside of any package scope' , async ( ) => {
9- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
10- '--experimental-type=module' ,
11- fixtures . path ( 'es-modules/loose.js' ) ,
12- ] ) ;
7+ describe ( 'the type flag should change the interpretation of certain files outside of any package scope' ,
8+ { concurrency : true } , ( ) => {
9+ it ( 'should run as ESM a .js file that is outside of any package scope' , async ( ) => {
10+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
11+ '--experimental-type=module' ,
12+ fixtures . path ( 'es-modules/loose.js' ) ,
13+ ] ) ;
1314
14- strictEqual ( stderr , '' ) ;
15- strictEqual ( stdout , 'executed\n' ) ;
16- strictEqual ( code , 0 ) ;
17- strictEqual ( signal , null ) ;
18- } ) ;
15+ strictEqual ( stderr , '' ) ;
16+ strictEqual ( stdout , 'executed\n' ) ;
17+ strictEqual ( code , 0 ) ;
18+ strictEqual ( signal , null ) ;
19+ } ) ;
1920
20- it ( 'should run as ESM an extensionless JavaScript file that is outside of any package scope' , async ( ) => {
21- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
22- '--experimental-type=module' ,
23- fixtures . path ( 'es-modules/noext-esm' ) ,
24- ] ) ;
21+ it ( 'should run as ESM an extensionless JavaScript file that is outside of any package scope' , async ( ) => {
22+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
23+ '--experimental-type=module' ,
24+ fixtures . path ( 'es-modules/noext-esm' ) ,
25+ ] ) ;
2526
26- strictEqual ( stderr , '' ) ;
27- strictEqual ( stdout , 'executed\n' ) ;
28- strictEqual ( code , 0 ) ;
29- strictEqual ( signal , null ) ;
30- } ) ;
27+ strictEqual ( stderr , '' ) ;
28+ strictEqual ( stdout , 'executed\n' ) ;
29+ strictEqual ( code , 0 ) ;
30+ strictEqual ( signal , null ) ;
31+ } ) ;
3132
32- it ( 'should run as Wasm an extensionless Wasm file that is outside of any package scope' , async ( ) => {
33- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
34- '--experimental-type=module' ,
35- '--experimental-wasm-modules' ,
36- '--no-warnings' ,
37- fixtures . path ( 'es-modules/noext-wasm' ) ,
38- ] ) ;
33+ it ( 'should run as Wasm an extensionless Wasm file that is outside of any package scope' , async ( ) => {
34+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
35+ '--experimental-type=module' ,
36+ '--experimental-wasm-modules' ,
37+ '--no-warnings' ,
38+ fixtures . path ( 'es-modules/noext-wasm' ) ,
39+ ] ) ;
3940
40- strictEqual ( stderr , '' ) ;
41- strictEqual ( stdout , '' ) ;
42- strictEqual ( code , 0 ) ;
43- strictEqual ( signal , null ) ;
44- } ) ;
41+ strictEqual ( stderr , '' ) ;
42+ strictEqual ( stdout , '' ) ;
43+ strictEqual ( code , 0 ) ;
44+ strictEqual ( signal , null ) ;
45+ } ) ;
4546
46- it ( 'should import as ESM a .js file that is outside of any package scope' , async ( ) => {
47- const { default : defaultExport } = await import ( fixtures . fileURL ( 'es-modules/loose.js' ) ) ;
48- strictEqual ( defaultExport , 'module' ) ;
49- } ) ;
47+ it ( 'should import as ESM a .js file that is outside of any package scope' , async ( ) => {
48+ const { default : defaultExport } = await import ( fixtures . fileURL ( 'es-modules/loose.js' ) ) ;
49+ strictEqual ( defaultExport , 'module' ) ;
50+ } ) ;
5051
51- it ( 'should import as ESM an extensionless JavaScript file that is outside of any package scope' , async ( ) => {
52- const { default : defaultExport } = await import ( fixtures . fileURL ( 'es-modules/noext-esm' ) ) ;
53- strictEqual ( defaultExport , 'module' ) ;
54- } ) ;
52+ it ( 'should import as ESM an extensionless JavaScript file that is outside of any package scope' ,
53+ async ( ) => {
54+ const { default : defaultExport } = await import ( fixtures . fileURL ( 'es-modules/noext-esm' ) ) ;
55+ strictEqual ( defaultExport , 'module' ) ;
56+ } ) ;
5557
56- it ( 'should import as Wasm an extensionless Wasm file that is outside of any package scope' , async ( ) => {
57- const { add } = await import ( fixtures . fileURL ( 'es-modules/noext-wasm' ) ) ;
58- strictEqual ( add ( 1 , 2 ) , 3 ) ;
59- } ) ;
58+ it ( 'should import as Wasm an extensionless Wasm file that is outside of any package scope' , async ( ) => {
59+ const { add } = await import ( fixtures . fileURL ( 'es-modules/noext-wasm' ) ) ;
60+ strictEqual ( add ( 1 , 2 ) , 3 ) ;
61+ } ) ;
6062
61- it ( 'should check as ESM input passed via --check' , async ( ) => {
62- const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
63- '--experimental-type=module' ,
64- '--check' ,
65- fixtures . path ( 'es-modules/loose.js' ) ,
66- ] ) ;
63+ it ( 'should check as ESM input passed via --check' , async ( ) => {
64+ const { code, signal, stdout, stderr } = await spawnPromisified ( process . execPath , [
65+ '--experimental-type=module' ,
66+ '--check' ,
67+ fixtures . path ( 'es-modules/loose.js' ) ,
68+ ] ) ;
6769
68- strictEqual ( stderr , '' ) ;
69- strictEqual ( stdout , '' ) ;
70- strictEqual ( code , 0 ) ;
71- strictEqual ( signal , null ) ;
72- } ) ;
73- } ) ;
70+ strictEqual ( stderr , '' ) ;
71+ strictEqual ( stdout , '' ) ;
72+ strictEqual ( code , 0 ) ;
73+ strictEqual ( signal , null ) ;
74+ } ) ;
75+ } ) ;
0 commit comments