File tree Expand file tree Collapse file tree 5 files changed +74
-0
lines changed
fixtures/es-modules/esm-esm-cjs-esm-esm-cycle Expand file tree Collapse file tree 5 files changed +74
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict' ;
2
+
3
+ require ( '../common' ) ;
4
+ const { spawnSyncAndAssert } = require ( '../common/child_process' ) ;
5
+ const fixtures = require ( '../common/fixtures' ) ;
6
+
7
+ // a.mjs -> b.mjs -> c.cjs -> z.mjs -> a.mjs
8
+ {
9
+ spawnSyncAndAssert (
10
+ process . execPath ,
11
+ [
12
+ '--experimental-require-module' ,
13
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/a.mjs' ) ,
14
+ ] ,
15
+ {
16
+ signal : null ,
17
+ status : 1 ,
18
+ stderr : / C a n n o t i m p o r t M o d u l e \. \/ a \. m j s i n a c y c l e \. \( f r o m .* z \. m j s \) / ,
19
+ }
20
+ ) ;
21
+ }
22
+
23
+ // b.mjs -> c.cjs -> z.mjs -> a.mjs -> b.mjs
24
+ {
25
+ spawnSyncAndAssert (
26
+ process . execPath ,
27
+ [
28
+ '--experimental-require-module' ,
29
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/b.mjs' ) ,
30
+ ] ,
31
+ {
32
+ signal : null ,
33
+ status : 1 ,
34
+ stderr : / C a n n o t i m p o r t M o d u l e \. \/ b \. m j s i n a c y c l e \. \( f r o m .* a \. m j s \) / ,
35
+ }
36
+ ) ;
37
+ }
38
+
39
+ // c.cjs -> z.mjs -> a.mjs -> b.mjs -> c.cjs
40
+ {
41
+ spawnSyncAndAssert (
42
+ process . execPath ,
43
+ [
44
+ '--experimental-require-module' ,
45
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/c.cjs' ) ,
46
+ ] ,
47
+ {
48
+ signal : null ,
49
+ status : 1 ,
50
+ stderr : / C a n n o t i m p o r t C o m m o n J S M o d u l e \. \/ c \. c j s i n a c y c l e \. \( f r o m .* b \. m j s \) / ,
51
+ }
52
+ ) ;
53
+ }
54
+
55
+
56
+ // z.mjs -> a.mjs -> b.mjs -> c.cjs -> z.mjs
57
+ {
58
+ spawnSyncAndAssert (
59
+ process . execPath ,
60
+ [
61
+ '--experimental-require-module' ,
62
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/z.mjs' ) ,
63
+ ] ,
64
+ {
65
+ signal : null ,
66
+ status : 1 ,
67
+ stderr : / C a n n o t r e q u i r e \( \) E S M o d u l e .* z \. m j s i n a c y c l e \. \( f r o m .* c \. c j s \) / ,
68
+ }
69
+ ) ;
70
+ }
Original file line number Diff line number Diff line change
1
+ import './b.mjs'
Original file line number Diff line number Diff line change
1
+ import './c.cjs'
Original file line number Diff line number Diff line change
1
+ require ( './z.mjs' )
Original file line number Diff line number Diff line change
1
+ import './a.mjs'
You canβt perform that action at this time.
0 commit comments