mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-08 12:32:43 +00:00
The integration suite used to share a single module graph across files (`pool: forks`, `fileParallelism: false`, `isolate: false`). That kept the container boot amortised but meant a `vi.mock()` declaration in one file lost to whichever earlier file had already pulled the real module into the graph. `apns-dispatch.test.ts` and `integration-status.test.ts` both fall through to `@/lib/notifications/dispatcher` (and its `@parse/node-apn` / telegram sender deps); when a sibling test mounted the real dispatcher first, the mock factories registered later silently no-op'd and the in-suite run reported the mock as called zero times. Each file still passed in isolation, which is the fingerprint the v1.4.35.1 closure already flagged as pre-existing. Flip the integration config to `isolate: true`. Per-file module isolation costs ~10 s of import rebuild across the 56-file run; the Postgres testcontainer + migrations live in `globalSetup`, so the slow part (container boot, ~5-15 s) is unaffected. The two `withings-*-sync.test.ts` files were previously dependent on a sibling setting `process.env.ENCRYPTION_KEY` before them — pin the deterministic test key in each file so they remain self-contained under per-file isolation. Locally `pnpm test:integration` now shows the four target failures green; the remaining two bp-in-target flakes are pre-existing local-only data drift that passed on CI under the old isolation flag and continue to be ordering-independent.