0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
nodejs/test/es-module/test-esm-syntax-error.mjs
Jacob Smith 447635b440
test: refactor ESM tests to improve performance
PR-URL: https://github.com/nodejs/node/pull/43784
Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2022-07-29 10:42:55 +02:00

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