Skip to content

Commit

Permalink
test: assert carret symbol position
Browse files Browse the repository at this point in the history
  • Loading branch information
geeksilva97 committed Oct 27, 2024
1 parent ed89392 commit ded0ecb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ test('correctly reports errors when an ESM module is required with --no-experime
//
// package-type-module/require-esm-error-annotation/index.cjs:1
// const app = require('./app');
// ^

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

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

assert.strictEqual(result.status, 1);
assert(result.stderr.toString().match(matchRegex));
assert.deepStrictEqual(result.stdout.toString(), '');

Check failure on line 22 in test/parallel/test-require-esm-with-no-experimental-require-module.mjs

View workflow job for this annotation

GitHub Actions / lint-js-and-md

Use strictEqual instead of deepStrictEqual for literals or undefined
});

0 comments on commit ded0ecb

Please sign in to comment.