mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-08-23 23:02:17 +10:00
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:
+3
-1
@@ -44,7 +44,9 @@ export const createVitestProjectConfig = ({
|
|||||||
include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
|
include: ["src/**/*.{test,spec}.?(c|m)[jt]s?(x)"],
|
||||||
exclude: ["node_modules", "dist", ".output", "coverage", "reports"],
|
exclude: ["node_modules", "dist", ".output", "coverage", "reports"],
|
||||||
pool: "threads",
|
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,
|
passWithNoTests: true,
|
||||||
coverage: {
|
coverage: {
|
||||||
provider: "v8",
|
provider: "v8",
|
||||||
|
|||||||
Reference in New Issue
Block a user