test(FN-2122): isolate HOME for core and CLI vitest runs
- Add test setup files in core and CLI that override HOME to a per-worker temp directory - Wire the new isolation setup into core and CLI vitest setupFiles before existing test bootstrap - Add a core canary test to verify HOME, homedir(), and defaultGlobalDir() resolve under isolated temp paths - Document how global HOME isolation complements per-fixture isolation in test-project utilities
This commit is contained in:
10
packages/cli/src/__tests__/setup-test-isolation.ts
Normal file
10
packages/cli/src/__tests__/setup-test-isolation.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Global test isolation for CLI package.
|
||||
* @see packages/core/src/__tests__/setup-test-isolation.ts
|
||||
*/
|
||||
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;
|
||||
Reference in New Issue
Block a user