fix(test): isolate kitchen sink rpc home env

This commit is contained in:
Vincent Koc
2026-05-26 01:36:05 +02:00
parent 719ce7f96f
commit 60afca187d
2 changed files with 8 additions and 2 deletions

View File

@@ -68,7 +68,8 @@ export function makeEnv() {
env: {
...process.env,
HOME: home,
OPENCLAW_HOME: stateDir,
USERPROFILE: home,
OPENCLAW_HOME: home,
OPENCLAW_STATE_DIR: stateDir,
OPENCLAW_CONFIG_PATH: path.join(stateDir, "openclaw.json"),
OPENCLAW_NO_ONBOARD: "1",

View File

@@ -21,7 +21,12 @@ describe("kitchen-sink RPC isolated state", () => {
const { root, env } = makeEnv();
expect(root).toContain("openclaw-kitchen-sink-rpc-");
expect(existsSync(env.OPENCLAW_HOME)).toBe(true);
expect(env.HOME).toBe(path.join(root, "home"));
expect(env.USERPROFILE).toBe(env.HOME);
expect(env.OPENCLAW_HOME).toBe(env.HOME);
expect(env.OPENCLAW_STATE_DIR).toBe(path.join(env.HOME, ".openclaw"));
expect(env.OPENCLAW_CONFIG_PATH).toBe(path.join(env.OPENCLAW_STATE_DIR, "openclaw.json"));
expect(existsSync(env.OPENCLAW_STATE_DIR)).toBe(true);
await expect(cleanupKitchenSinkEnv(root)).resolves.toBe(true);