diff --git a/tests/skill/understand/test_extract_import_map.test.mjs b/tests/skill/understand/test_extract_import_map.test.mjs index ee64136..a4be65a 100644 --- a/tests/skill/understand/test_extract_import_map.test.mjs +++ b/tests/skill/understand/test_extract_import_map.test.mjs @@ -1492,3 +1492,55 @@ describe('extract-import-map.mjs — tree-sitter init graceful failure', () => { expect(result.output.stats.totalEdges).toBe(0); }); }); + +describe('extract-import-map.mjs — deterministic stderr ordering across loaders', () => { + let projectRoot; + + afterEach(() => { + if (projectRoot) { + rmSync(projectRoot, { recursive: true, force: true }); + projectRoot = null; + } + }); + + // Regression for the parallel-loader stderr-order bug surfaced in + // PR #346 review: tsconfig / go.mod / composer.json loaders now run + // concurrently, but warnings must still emit in the pre-PR canonical + // order (tsconfig → go → php). If the loaders streamed warnings + // mid-flight, I/O timing could reorder them — the assertions below + // catch that regression. + it('emits warnings in canonical order (tsconfig, go, php) regardless of I/O timing', () => { + projectRoot = setupTree({ + 'tsconfig.json': '{ "compilerOptions": { "baseUrl": ".", ', // unterminated + 'composer.json': '{ "autoload": { "psr-4": { "App\\\\": "src/" }, ', // unterminated + 'src/index.ts': `import { foo } from './foo';\n`, + 'src/foo.ts': `export const foo = 1;\n`, + 'src/Http/Controller.php': + `