From 8470a6bf1f83a54d9c7839cb5526ccfb44a94ae6 Mon Sep 17 00:00:00 2001 From: acamq <179265037+acamq@users.noreply.github.com> Date: Sun, 15 Mar 2026 15:30:52 -0600 Subject: [PATCH] fix(test): isolate XDG_CONFIG_HOME in Windows CLI tests Windows CLI tests were not deleting XDG_CONFIG_HOME, making them fragile in environments where this variable is set. getCliConfigDir() reads XDG_CONFIG_HOME on all platforms, not just Linux. --- src/shared/opencode-config-dir.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/shared/opencode-config-dir.test.ts b/src/shared/opencode-config-dir.test.ts index 0ac10e363..86d3afc55 100644 --- a/src/shared/opencode-config-dir.test.ts +++ b/src/shared/opencode-config-dir.test.ts @@ -183,6 +183,7 @@ describe("opencode-config-dir", () => { // given opencode CLI binary detected, platform is Windows Object.defineProperty(process, "platform", { value: "win32" }) delete process.env.APPDATA + delete process.env.XDG_CONFIG_HOME delete process.env.OPENCODE_CONFIG_DIR // when getOpenCodeConfigDir is called with binary="opencode" @@ -197,6 +198,7 @@ describe("opencode-config-dir", () => { // (regression test: previously would check AppData for existing config) Object.defineProperty(process, "platform", { value: "win32" }) process.env.APPDATA = "C:\\Users\\TestUser\\AppData\\Roaming" + delete process.env.XDG_CONFIG_HOME delete process.env.OPENCODE_CONFIG_DIR // when getOpenCodeConfigDir is called with binary="opencode"