feat(FN-2606): merge fusion/fn-2606 (auto-resolved)

- fix(FN-2606): complete Step 4 — clean up mkdtemp test directories
- test(FN-2606): complete Step 3 — add isolation guard coverage
- feat(FN-2606): complete Step 2 — add engine/dashboard HOME test isolation setup
This commit is contained in:
Fusion
2026-04-26 13:00:56 -07:00
committed by gsxdsm
parent 63914028e1
commit caa773cb95
11 changed files with 149 additions and 27 deletions

View File

@@ -0,0 +1,12 @@
/**
* Global test isolation: prevents dashboard tests from writing to the real ~/.fusion/ directory.
*
* This runs in every Vitest worker before shared setup. By forcing process.env.HOME
* to a fresh temp directory, homedir()-derived paths resolve to isolated locations.
*/
import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
const tempHome = mkdtempSync(join(tmpdir(), "fn-test-home-"));
process.env.HOME = tempHome;