1import { spawnPromisified } from '../common/index.mjs'; 2import { path } from '../common/fixtures.mjs'; 3import { match, notStrictEqual } from 'node:assert'; 4import { execPath } from 'node:process'; 5import { describe, it } from 'node:test'; 6 7 8describe('ESM: importing a module with syntax error(s)', { concurrency: true }, () => { 9 it('should throw', async () => { 10 const { code, stderr } = await spawnPromisified(execPath, [ 11 path('es-module-loaders', 'syntax-error.mjs'), 12 ]); 13 match(stderr, /SyntaxError:/); 14 notStrictEqual(code, 0); 15 }); 16}); 17