11cb0ef41Sopenharmony_ciimport { spawnPromisified } from '../common/index.mjs'; 21cb0ef41Sopenharmony_ciimport { fixturesDir } 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: module not found hint', { concurrency: true }, () => { 91cb0ef41Sopenharmony_ci for ( 101cb0ef41Sopenharmony_ci const { input, expected } 111cb0ef41Sopenharmony_ci of [ 121cb0ef41Sopenharmony_ci { 131cb0ef41Sopenharmony_ci input: 'import "./print-error-message"', 141cb0ef41Sopenharmony_ci // Did you mean to import ../print-error-message.js? 151cb0ef41Sopenharmony_ci expected: / \.\.\/print-error-message\.js\?/, 161cb0ef41Sopenharmony_ci }, 171cb0ef41Sopenharmony_ci { 181cb0ef41Sopenharmony_ci input: 'import obj from "some_module/obj"', 191cb0ef41Sopenharmony_ci expected: / some_module\/obj\.js\?/, 201cb0ef41Sopenharmony_ci }, 211cb0ef41Sopenharmony_ci ] 221cb0ef41Sopenharmony_ci ) it('should cite a variant form', async () => { 231cb0ef41Sopenharmony_ci const { code, stderr } = await spawnPromisified(execPath, [ 241cb0ef41Sopenharmony_ci '--input-type=module', 251cb0ef41Sopenharmony_ci '--eval', 261cb0ef41Sopenharmony_ci input, 271cb0ef41Sopenharmony_ci ], { 281cb0ef41Sopenharmony_ci cwd: fixturesDir, 291cb0ef41Sopenharmony_ci }); 301cb0ef41Sopenharmony_ci 311cb0ef41Sopenharmony_ci match(stderr, expected); 321cb0ef41Sopenharmony_ci notStrictEqual(code, 0); 331cb0ef41Sopenharmony_ci }); 341cb0ef41Sopenharmony_ci}); 35