mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
PR-URL: https://github.com/nodejs/node/pull/41352 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
20 lines
527 B
JavaScript
20 lines
527 B
JavaScript
import { mustCall } from '../common/index.mjs';
|
|
import { path } from '../common/fixtures.mjs';
|
|
import { match, notStrictEqual } from 'assert';
|
|
import { spawn } from 'child_process';
|
|
import { execPath } from 'process';
|
|
|
|
const child = spawn(execPath, [
|
|
path('es-module-loaders', 'syntax-error.mjs'),
|
|
]);
|
|
|
|
let stderr = '';
|
|
child.stderr.setEncoding('utf8');
|
|
child.stderr.on('data', (data) => {
|
|
stderr += data;
|
|
});
|
|
child.on('close', mustCall((code, _signal) => {
|
|
notStrictEqual(code, 0);
|
|
match(stderr, /SyntaxError:/);
|
|
}));
|