11cb0ef41Sopenharmony_ciimport { spawnPromisified } from '../common/index.mjs'; 21cb0ef41Sopenharmony_ciimport { path } from '../common/fixtures.mjs'; 31cb0ef41Sopenharmony_ciimport { match, notStrictEqual } from 'node:assert'; 41cb0ef41Sopenharmony_ciimport { execPath } from 'node:process'; 51cb0ef41Sopenharmony_ciimport { describe, it } from 'node:test'; 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cidescribe('ESM: importing a module with syntax error(s)', { concurrency: true }, () => { 91cb0ef41Sopenharmony_ci it('should throw', async () => { 101cb0ef41Sopenharmony_ci const { code, stderr } = await spawnPromisified(execPath, [ 111cb0ef41Sopenharmony_ci path('es-module-loaders', 'syntax-error.mjs'), 121cb0ef41Sopenharmony_ci ]); 131cb0ef41Sopenharmony_ci match(stderr, /SyntaxError:/); 141cb0ef41Sopenharmony_ci notStrictEqual(code, 0); 151cb0ef41Sopenharmony_ci }); 161cb0ef41Sopenharmony_ci}); 17