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 caab55c4c0426a656af4566d2cb3bee9ae71ed4b
24 changes: 24 additions & 0 deletions test/es-module/test-esm-loader-with-syntax-error.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import '../common/index.mjs';
import { path } from '../common/fixtures.mjs';
import { ok } from 'assert';
import { spawn } from 'child_process';
import { execPath } from 'process';

const child = spawn(execPath, [
'--experimental-loader',
path('/es-module-loaders/syntax-error.mjs'),
path('/print-error-message.js'),
]);

let stderr = '';
child.stderr.setEncoding('utf8');
child.stderr.on('data', (data) => {
stderr += data;
});
child.on('close', () => {
stderr = stderr.toString()
ok(stderr.includes(
'SyntaxError: Malformed arrow function parameter list'
));
ok(!stderr.includes('Bad command or file name'));
});
3 changes: 0 additions & 3 deletions test/message/esm_loader_syntax_error.mjs

This file was deleted.

12 changes: 0 additions & 12 deletions test/message/esm_loader_syntax_error.out

This file was deleted.