Files
hyperframes/packages/cli/scripts/test-file-home.mjs
T
Miguel Ángel 2b86c49dc2 test(cli): give each test file its own home so renders never wait on another file's lock (#7526)
* test(cli): give each test file its own home so renders never wait on another file's lock

* test(cli): pin the cli test config after adding the per-file home setup
2026-11-11 02:58:32 +00:00

11 lines
519 B
JavaScript

// Each test file gets a home of its own: per-user state such as the render lock is never
// shared by test files running at the same time, so one file's render cannot make another's wait.
import { mkdtempSync, rmSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { afterAll } from "vitest";
const home = mkdtempSync(join(tmpdir(), "hf-test-file-home-"));
process.env.HOME = process.env.USERPROFILE = home;
afterAll(() => rmSync(home, { recursive: true, force: true }));