@@ -20,7 +20,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
20
20
// Check with just `path`
21
21
const mf = new Miniflare ( {
22
22
compatibilityDate : "2023-08-01" ,
23
- compatibilityFlags : [ "nodejs_compat " ] ,
23
+ compatibilityFlags : [ "nodejs_compat_v2 " ] ,
24
24
// TODO(soon): remove `modulesRoot` once https://github.com/cloudflare/workerd/issues/1101 fixed
25
25
// and add separate test for that
26
26
modulesRoot : ROOT ,
@@ -29,7 +29,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
29
29
{ type : "ESModule" , path : path . join ( ROOT , "blobs.mjs" ) } ,
30
30
{ type : "ESModule" , path : path . join ( ROOT , "blobs-indirect.mjs" ) } ,
31
31
{ type : "CommonJS" , path : path . join ( ROOT , "index.cjs" ) } ,
32
- { type : "NodeJsCompatModule " , path : path . join ( ROOT , "index.node.cjs" ) } ,
32
+ { type : "CommonJS " , path : path . join ( ROOT , "index.node.cjs" ) } ,
33
33
// Testing modules in subdirectories
34
34
{ type : "Text" , path : path . join ( ROOT , "blobs" , "text.txt" ) } ,
35
35
{ type : "Data" , path : path . join ( ROOT , "blobs" , "data.bin" ) } ,
@@ -51,7 +51,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
51
51
"AGFzbQEAAAABBwFgAn9/AX8DAgEABwcBA2FkZAAACgkBBwAgACABawsACgRuYW1lAgMBAAA=" ;
52
52
await mf . setOptions ( {
53
53
compatibilityDate : "2023-08-01" ,
54
- compatibilityFlags : [ "nodejs_compat " ] ,
54
+ compatibilityFlags : [ "nodejs_compat_v2 " ] ,
55
55
modules : [
56
56
{ type : "ESModule" , path : path . join ( ROOT , "index.mjs" ) } ,
57
57
{
@@ -79,7 +79,7 @@ test("Miniflare: accepts manually defined modules", async (t) => {
79
79
` ,
80
80
} ,
81
81
{
82
- type : "NodeJsCompatModule " ,
82
+ type : "CommonJS " ,
83
83
path : path . join ( ROOT , "index.node.cjs" ) ,
84
84
contents : `module.exports = "node:";` ,
85
85
} ,
@@ -112,14 +112,14 @@ test("Miniflare: automatically collects modules", async (t) => {
112
112
modules : true ,
113
113
modulesRoot : ROOT ,
114
114
modulesRules : [
115
- // Implicitly testing default module rules for `ESModule` and `CommonJS`
116
- { type : "NodeJsCompatModule " , include : [ "**/*.node.cjs" ] } ,
115
+ // Implicitly testing default module rules for `ESModule`
116
+ { type : "CommonJS " , include : [ "**/*.node.cjs" , "**/* .cjs"] } ,
117
117
{ type : "Text" , include : [ "**/*.txt" ] } ,
118
118
{ type : "Data" , include : [ "**/*.bin" ] } ,
119
119
{ type : "CompiledWasm" , include : [ "**/*.wasm" ] } ,
120
120
] ,
121
121
compatibilityDate : "2023-08-01" ,
122
- compatibilityFlags : [ "nodejs_compat " ] ,
122
+ compatibilityFlags : [ "nodejs_compat_v2 " ] ,
123
123
scriptPath : path . join ( ROOT , "index.mjs" ) ,
124
124
} ) ;
125
125
t . teardown ( ( ) => mf . dispose ( ) ) ;
@@ -207,13 +207,13 @@ test("Miniflare: cannot automatically collect modules from dynamic import expres
207
207
modulesRoot : ROOT ,
208
208
modulesRules : [
209
209
// Implicitly testing default module rules for `ESModule` and `CommonJS`
210
- { type : "NodeJsCompatModule " , include : [ "**/*.node.cjs" ] } ,
210
+ { type : "CommonJS " , include : [ "**/*.node.cjs" , "**/* .cjs"] } ,
211
211
{ type : "Text" , include : [ "**/*.txt" ] } ,
212
212
{ type : "Data" , include : [ "**/*.bin" ] } ,
213
213
{ type : "CompiledWasm" , include : [ "**/*.wasm" ] } ,
214
214
] ,
215
215
compatibilityDate : "2023-08-01" ,
216
- compatibilityFlags : [ "nodejs_compat " ] ,
216
+ compatibilityFlags : [ "nodejs_compat_v2 " ] ,
217
217
scriptPath,
218
218
} ) ;
219
219
@@ -233,7 +233,7 @@ You must manually define your modules when constructing Miniflare:
233
233
modules: [
234
234
{ type: "ESModule", path: "index-dynamic.mjs" },
235
235
{ type: "CommonJS", path: "index.cjs" },
236
- { type: "NodeJsCompatModule ", path: "index.node.cjs" },
236
+ { type: "CommonJS ", path: "index.node.cjs" },
237
237
{ type: "ESModule", path: "blobs-indirect.mjs" },
238
238
{ type: "ESModule", path: "blobs.mjs" },
239
239
{ type: "Text", path: "blobs/text.txt" },
0 commit comments