mirror of
https://github.com/yamadashy/repomix.git
synced 2026-02-03 11:33:39 +01:00
This commit resolves test coverage instability that occurred after implementing JS/TS config support. Coverage was fluctuating between 68-71% on each test run, caused by jiti dynamically transforming src/ files that were already instrumented by Vitest for coverage tracking. Root Cause: - Test fixture files imported `defineConfig` from src/index.js - jiti transformed the entire src/ directory when loading fixtures - Same files existed in two versions (Vitest-instrumented vs jiti-transformed) - v8 coverage tracker produced non-deterministic results Solution: 1. Added DI pattern to loadFileConfig with defaultJitiImport factory 2. Removed defineConfig imports from all test fixtures (use plain objects) 3. Mock jiti in dynamic config tests to prevent src/ transformation Results: - Coverage now stable at 89.34% (previously 68-71%) - Coverage improved by ~19% due to accurate instrumentation - Integration test runtime improved from 3.8s to 0.1s - All tests pass with zero lint errors Related Changes: - Reverted temporary Vitest config workarounds (sequence.shuffle, isolate) - Extracted defaultJitiImport as reusable factory function