Skip to content

Commit

Permalink
Update test/es-module/test-esm-detect-ambiguous.mjs
Browse files Browse the repository at this point in the history
Co-authored-by: Geoffrey Booth <[email protected]>
  • Loading branch information
mertcanaltin and GeoffreyBooth authored Nov 30, 2024
1 parent 5040118 commit 8e720b1
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions test/es-module/test-esm-detect-ambiguous.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,7 @@ describe('Module syntax detection', { concurrency: !process.env.TEST_PARALLEL },
it('throws on undefined `require` when top-level `await` triggers ESM parsing', async () => {
const { stdout, stderr, code, signal } = await spawnPromisified(process.execPath, [
'--eval',
`
const fs = require("node:fs");
await Promise.resolve();
`,
'const fs = require("node:fs"); await Promise.resolve();',
]);

match(stderr, /ReferenceError: require is not defined in ES module scope/);
Expand Down

0 comments on commit 8e720b1

Please sign in to comment.