- test(FN-2944): cover already checked out worktree conflict recovery - fix(FN-2944): recognize git already checked out worktree conflict - fix(engine): auto-recover from squash-merge orphan rebase failures Fusion-Task-Id: FN-2944
21 lines
708 B
TypeScript
21 lines
708 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;
|
|
process.env.USERPROFILE = tempHome;
|
|
if (process.platform === "win32") {
|
|
const match = tempHome.match(/^([A-Za-z]:)(.*)$/);
|
|
if (match) {
|
|
process.env.HOMEDRIVE = match[1];
|
|
process.env.HOMEPATH = match[2] || "\\";
|
|
}
|
|
}
|