11cb0ef41Sopenharmony_ciimport { spawnPromisified } from '../common/index.mjs'; 21cb0ef41Sopenharmony_ciimport * as fixtures from '../common/fixtures.mjs'; 31cb0ef41Sopenharmony_ciimport assert from 'node:assert'; 41cb0ef41Sopenharmony_ciimport { execPath } from 'node:process'; 51cb0ef41Sopenharmony_ciimport { describe, it } from 'node:test'; 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_cidescribe('ESM: named JSON exports', { concurrency: true }, () => { 91cb0ef41Sopenharmony_ci it('should throw, citing named import', async () => { 101cb0ef41Sopenharmony_ci const { code, stderr } = await spawnPromisified(execPath, [ 111cb0ef41Sopenharmony_ci fixtures.path('es-modules', 'import-json-named-export.mjs'), 121cb0ef41Sopenharmony_ci ]); 131cb0ef41Sopenharmony_ci 141cb0ef41Sopenharmony_ci // SyntaxError: The requested module '../experimental.json' 151cb0ef41Sopenharmony_ci // does not provide an export named 'ofLife' 161cb0ef41Sopenharmony_ci assert.match(stderr, /SyntaxError:/); 171cb0ef41Sopenharmony_ci assert.match(stderr, /'\.\.\/experimental\.json'/); 181cb0ef41Sopenharmony_ci assert.match(stderr, /'ofLife'/); 191cb0ef41Sopenharmony_ci 201cb0ef41Sopenharmony_ci assert.notStrictEqual(code, 0); 211cb0ef41Sopenharmony_ci }); 221cb0ef41Sopenharmony_ci}); 23