Skip to content

Commit

Permalink
add pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Feb 13, 2025
1 parent 2c5acda commit 98b0d48
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions test/es-module/test-esm-wasm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,11 @@ describe('ESM: WASM modules', { concurrency: !process.env.TEST_PARALLEL }, () =>
'--eval',
[
'import { ok, strictEqual } from "node:assert";',
'try {',
` await import.source(${JSON.stringify(fileUrl)});`,
' ok(false);',
'}',
'catch (e) {',
`await assert.rejects(import.source(${JSON.stringify(fileUrl)}), (e) => {`,
' strictEqual(e instanceof SyntaxError, true);',
' strictEqual(e.message.includes("Source phase import object is not defined for module"), true);',
` strictEqual(e.message.includes(${JSON.stringify(fileUrl)}), true);`,
'}',
'});',
].join('\n'),
]);

Expand All @@ -204,7 +200,7 @@ describe('ESM: WASM modules', { concurrency: !process.env.TEST_PARALLEL }, () =>
'--eval',
`import source nosource from ${JSON.stringify(fileUrl)};`,
]);
ok(stderr.includes('Source phase import object is not defined for module'));
match(stderr, /Source phase import object is not defined for module/);
ok(stderr.includes(fileUrl));
strictEqual(stdout, '');
notStrictEqual(code, 0);
Expand All @@ -224,7 +220,7 @@ describe('ESM: WASM modules', { concurrency: !process.env.TEST_PARALLEL }, () =>
'await m1.evaluate();',
].join('\n'),
]);
ok(stderr.includes('Source phase import object is not defined for module'));
match(stderr, /Source phase import object is not defined for module/);
strictEqual(stdout, '');
notStrictEqual(code, 0);
});
Expand All @@ -246,7 +242,7 @@ describe('ESM: WASM modules', { concurrency: !process.env.TEST_PARALLEL }, () =>
'await m1.evaluate();',
].join('\n'),
]);
ok(stderr.includes('Source phase import object is not defined for module'));
match(stderr, /Source phase import object is not defined for module/);
strictEqual(stdout, '');
notStrictEqual(code, 0);
});
Expand Down

0 comments on commit 98b0d48

Please sign in to comment.