0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/test/es-module/test-esm-syntax-error.mjs

17 lines
563 B
JavaScript
Raw Normal View History

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);
});
});