test: isolate test files to stop cross-file mock leakage

Without isolation the files in a worker share one module registry, so a
vi.mock of @reactive-resume/env/server in one file leaked into another and
whichever file imported the module first won. Measured on a clean cache,
isolate: false failed four of four whole-repo runs; with isolation, none.
This commit is contained in:
Amruth Pillai
2026-08-17 22:19:52 +02:00
parent 60d0440763
commit e8508e6d03
+3 -1
View File
@@ -44,7 +44,9 @@ export const createVitestProjectConfig = ({
include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
exclude: ["node_modules", "dist", ".output", "coverage", "reports"],
pool: "threads",
isolate: false,
// Isolation stays on: without it, test files in a worker share one module registry, so a
// `vi.mock` in one file leaks into another and whichever file imported a module first wins.
// That made every suite mocking `@reactive-resume/env/server` order-dependent and flaky.
passWithNoTests: true,
coverage: {
provider: "v8",