From e34fda559eee242ae9a75e00ab8e44f5635845d3 Mon Sep 17 00:00:00 2001 From: Dominic Date: Tue, 27 Jan 2026 19:31:27 -0600 Subject: [PATCH] fix(test): set USERPROFILE for Windows in CONFIG_PATH test The CONFIG_PATH test sets HOME to isolate the test environment, but on Windows os.homedir() uses USERPROFILE instead. This caused the test to use the global test home directory rather than the test-local temp dir, resulting in path mismatches. Fixes checks-windows CI failure introduced in e2c437e. --- src/config/paths.test.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/config/paths.test.ts b/src/config/paths.test.ts index e029a6a47..dd2f590ac 100644 --- a/src/config/paths.test.ts +++ b/src/config/paths.test.ts @@ -69,6 +69,7 @@ describe("state + config path candidates", () => { it("CONFIG_PATH prefers existing legacy filename when present", async () => { const root = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-config-")); const previousHome = process.env.HOME; + const previousUserProfile = process.env.USERPROFILE; const previousMoltbotConfig = process.env.MOLTBOT_CONFIG_PATH; const previousClawdbotConfig = process.env.CLAWDBOT_CONFIG_PATH; const previousMoltbotState = process.env.MOLTBOT_STATE_DIR; @@ -80,6 +81,7 @@ describe("state + config path candidates", () => { await fs.writeFile(legacyPath, "{}", "utf-8"); process.env.HOME = root; + process.env.USERPROFILE = root; delete process.env.MOLTBOT_CONFIG_PATH; delete process.env.CLAWDBOT_CONFIG_PATH; delete process.env.MOLTBOT_STATE_DIR; @@ -94,6 +96,11 @@ describe("state + config path candidates", () => { } else { process.env.HOME = previousHome; } + if (previousUserProfile === undefined) { + delete process.env.USERPROFILE; + } else { + process.env.USERPROFILE = previousUserProfile; + } if (previousMoltbotConfig === undefined) delete process.env.MOLTBOT_CONFIG_PATH; else process.env.MOLTBOT_CONFIG_PATH = previousMoltbotConfig; if (previousClawdbotConfig === undefined) delete process.env.CLAWDBOT_CONFIG_PATH;