Skip to content

Commit 7dc8b15

Browse files
committed
test: assert carret symbol position
1 parent ed89392 commit 7dc8b15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ test('correctly reports errors when an ESM module is required with --no-experime
99
//
1010
// package-type-module/require-esm-error-annotation/index.cjs:1
1111
// const app = require('./app');
12+
// ^
1213

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

1718
const result = spawnSync(process.execPath, args);
1819

1920
assert.strictEqual(result.status, 1);
2021
assert(result.stderr.toString().match(matchRegex));
22+
assert.strictEqual(result.stdout.toString(), '');
2123
});

0 commit comments

Comments
 (0)