mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 15:30:56 +01:00
447635b440
PR-URL: https://github.com/nodejs/node/pull/43784 Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
17 lines
563 B
JavaScript
17 lines
563 B
JavaScript
import { spawnPromisified } from '../common/index.mjs';
|
|
import { path } from '../common/fixtures.mjs';
|
|
import { match, notStrictEqual } from 'node:assert';
|
|
import { execPath } from 'node:process';
|
|
import { describe, it } from 'node:test';
|
|
|
|
|
|
describe('ESM: importing a module with syntax error(s)', { concurrency: true }, () => {
|
|
it('should throw', async () => {
|
|
const { code, stderr } = await spawnPromisified(execPath, [
|
|
path('es-module-loaders', 'syntax-error.mjs'),
|
|
]);
|
|
match(stderr, /SyntaxError:/);
|
|
notStrictEqual(code, 0);
|
|
});
|
|
});
|