- 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
13 lines
479 B
TypeScript
13 lines
479 B
TypeScript
/**
|
|
* 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;
|