11cb0ef41Sopenharmony_ciimport { spawnPromisified } from '../common/index.mjs';
21cb0ef41Sopenharmony_ciimport { fileURL } from '../common/fixtures.mjs';
31cb0ef41Sopenharmony_ciimport { match, strictEqual } from 'node:assert';
41cb0ef41Sopenharmony_ciimport { execPath } from 'node:process';
51cb0ef41Sopenharmony_ciimport { describe, it } from 'node:test';
61cb0ef41Sopenharmony_ci
71cb0ef41Sopenharmony_ci
81cb0ef41Sopenharmony_cidescribe('ESM: non-js extensions fail', { concurrency: true }, () => {
91cb0ef41Sopenharmony_ci  it(async () => {
101cb0ef41Sopenharmony_ci    const { code, stderr, signal } = await spawnPromisified(execPath, [
111cb0ef41Sopenharmony_ci      '--input-type=module',
121cb0ef41Sopenharmony_ci      '--eval',
131cb0ef41Sopenharmony_ci      `import ${JSON.stringify(fileURL('es-modules', 'file.unknown'))}`,
141cb0ef41Sopenharmony_ci    ]);
151cb0ef41Sopenharmony_ci
161cb0ef41Sopenharmony_ci    match(stderr, /ERR_UNKNOWN_FILE_EXTENSION/);
171cb0ef41Sopenharmony_ci    strictEqual(code, 1);
181cb0ef41Sopenharmony_ci    strictEqual(signal, null);
191cb0ef41Sopenharmony_ci  });
201cb0ef41Sopenharmony_ci});
21