Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! esm: refactor esm tests out of test/message
  • Loading branch information
GeoffreyBooth committed Jan 6, 2022
commit b042d99120c37570a54b7bed8ca9db2401c98f5e
7 changes: 4 additions & 3 deletions test/es-module/test-esm-export-not-found.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ const importStatementMultiline = `import {
child.on('close', () => {
Comment thread
GeoffreyBooth marked this conversation as resolved.
Outdated
// SyntaxError: The requested module './module-named-exports.mjs'
// does not provide an export named 'notfound'
ok(stderr.includes('SyntaxError:'));
ok(stderr.includes('SyntaxError:') || console.error(stderr));
Comment thread
GeoffreyBooth marked this conversation as resolved.
Outdated
// The quotes ensure that the path starts with ./ and not ../
ok(stderr.includes('\'./module-named-exports.mjs\''));
ok(stderr.includes('notfound'));
ok(stderr.includes('\'./module-named-exports.mjs\'') ||
console.error(stderr));
ok(stderr.includes('notfound') || console.error(stderr));
});
});
6 changes: 3 additions & 3 deletions test/es-module/test-esm-import-json-named-export.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ child.stderr.on('data', (data) => {
child.on('close', () => {
// SyntaxError: The requested module '../experimental.json'
// does not provide an export named 'ofLife'
ok(stderr.includes('SyntaxError:'));
ok(stderr.includes('\'../experimental.json\''));
ok(stderr.includes('\'ofLife\''));
ok(stderr.includes('SyntaxError:') || console.error(stderr));
ok(stderr.includes('\'../experimental.json\'') || console.error(stderr));
ok(stderr.includes('\'ofLife\'') || console.error(stderr));
});
6 changes: 3 additions & 3 deletions test/es-module/test-esm-loader-not-found.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ child.stderr.on('data', (data) => {
child.on('close', () => {
// Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'i-dont-exist'
// imported from
ok(stderr.includes('ERR_MODULE_NOT_FOUND'));
ok(stderr.includes('\'i-dont-exist\''));
ok(stderr.includes('ERR_MODULE_NOT_FOUND') || console.error(stderr));
ok(stderr.includes('\'i-dont-exist\'') || console.error(stderr));

ok(!stderr.includes('Bad command or file name'));
ok(!stderr.includes('Bad command or file name') || console.error(stderr));
});
2 changes: 1 addition & 1 deletion test/es-module/test-esm-loader-obsolete-hooks.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ child.on('close', () => {
ok(stderr.includes(
'DeprecationWarning: Obsolete loader hook(s) supplied and will be ' +
'ignored: dynamicInstantiate, getFormat, getSource, transformSource'
));
) || console.error(stderr));
});
4 changes: 2 additions & 2 deletions test/es-module/test-esm-loader-with-syntax-error.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ child.stderr.on('data', (data) => {
stderr += data;
});
child.on('close', () => {
ok(stderr.includes('SyntaxError:'));
ok(!stderr.includes('Bad command or file name'));
ok(stderr.includes('SyntaxError:') || console.error(stderr));
ok(!stderr.includes('Bad command or file name') || console.error(stderr));
});
2 changes: 1 addition & 1 deletion test/es-module/test-esm-module-not-found-commonjs-hint.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ import { execPath } from 'process';
stderr += data;
});
child.on('close', () => {
ok(stderr.includes(expected));
ok(stderr.includes(expected) || console.error(stderr));
});
});
2 changes: 1 addition & 1 deletion test/es-module/test-esm-syntax-error.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ child.stderr.on('data', (data) => {
stderr += data;
});
child.on('close', () => {
ok(stderr.includes('SyntaxError:'));
ok(stderr.includes('SyntaxError:') || console.error(stderr));
});