Skip to content

Commit 8234109

Browse files
committed
test: make test work on windows
1 parent 5b0e7f6 commit 8234109

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/parallel/test-require-esm-with-no-experimental-require-module.mjs

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ test('correctly reports errors when an ESM module is required with --no-experime
1111
// const app = require('./app');
1212
// ^
1313

14-
const matchRegex = /package-type-module\/require-esm-error-annotation\/index\.cjs:1[\r?\n]const app = require\('\.\/app'\);[\r?\n]\s{12}\^/;
14+
// const matchRegex = /package-type-module\/require-esm-error-annotation\/index\.cjs:1[\r?\n]const app = require\('\.\/app'\);[\r?\n]\s{12}\^/;
15+
const matchRegex = /package-type-module[\\/]+require-esm-error-annotation[\\/]+index\.cjs:1[\r?\n]const app = require\('\.\/app'\);[\r?\n]\s{12}\^/;
1516
const fixture = fixtures.path('es-modules/package-type-module/require-esm-error-annotation/index.cjs');
1617
const args = ['--no-experimental-require-module', fixture];
1718

@@ -29,7 +30,8 @@ test('correctly reports error for a longer stack trace', () => {
2930
// require('./app.js')
3031
// ^
3132

32-
const matchRegex = /package-type-module\/require-esm-error-annotation\/longer-stack\.cjs:6[\r?\n]\s{2}require\('\.\/app\.js'\)[\r?\n]\s{2}\^/;
33+
// const matchRegex = /package-type-module\/require-esm-error-annotation\/longer-stack\.cjs:6[\r?\n]\s{2}require\('\.\/app\.js'\)[\r?\n]\s{2}\^/;
34+
const matchRegex = /package-type-module[\\/]+require-esm-error-annotation[\\/]+longer-stack\.cjs:6[\r?\n]\s{2}require\('\.\/app\.js'\)[\r?\n]\s{2}\^/;
3335
const fixture = fixtures.path('es-modules/package-type-module/require-esm-error-annotation/longer-stack.cjs');
3436
const args = ['--no-experimental-require-module', fixture];
3537

0 commit comments

Comments
 (0)