File tree Expand file tree Collapse file tree 5 files changed +75
-0
lines changed
fixtures/es-modules/esm-esm-cjs-esm-esm-cycle Expand file tree Collapse file tree 5 files changed +75
-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
+ const assert = require ( 'assert' ) ;
7
+
8
+ // a.mjs -> b.mjs -> c.cjs -> z.mjs -> a.mjs
9
+ {
10
+ spawnSyncAndAssert (
11
+ process . execPath ,
12
+ [
13
+ '--experimental-require-module' ,
14
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/a.mjs' ) ,
15
+ ] ,
16
+ {
17
+ signal : null ,
18
+ status : 1 ,
19
+ 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 \) / ,
20
+ }
21
+ ) ;
22
+ }
23
+
24
+ // b.mjs -> c.cjs -> z.mjs -> a.mjs -> b.mjs
25
+ {
26
+ spawnSyncAndAssert (
27
+ process . execPath ,
28
+ [
29
+ '--experimental-require-module' ,
30
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/b.mjs' ) ,
31
+ ] ,
32
+ {
33
+ signal : null ,
34
+ status : 1 ,
35
+ 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 \) / ,
36
+ }
37
+ ) ;
38
+ }
39
+
40
+ // c.cjs -> z.mjs -> a.mjs -> b.mjs -> c.cjs
41
+ {
42
+ spawnSyncAndAssert (
43
+ process . execPath ,
44
+ [
45
+ '--experimental-require-module' ,
46
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/c.cjs' ) ,
47
+ ] ,
48
+ {
49
+ signal : null ,
50
+ status : 1 ,
51
+ 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 \) / ,
52
+ }
53
+ ) ;
54
+ }
55
+
56
+
57
+ // z.mjs -> a.mjs -> b.mjs -> c.cjs -> z.mjs
58
+ {
59
+ spawnSyncAndAssert (
60
+ process . execPath ,
61
+ [
62
+ '--experimental-require-module' ,
63
+ fixtures . path ( 'es-modules/esm-esm-cjs-esm-esm-cycle/z.mjs' ) ,
64
+ ] ,
65
+ {
66
+ signal : null ,
67
+ status : 1 ,
68
+ 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 \) / ,
69
+ }
70
+ ) ;
71
+ }
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