test: skip unix-path OPENCLAW_HOME tests on Windows (#12206)

This commit is contained in:
max
2026-02-08 16:56:21 -08:00
committed by GitHub
parent 223eee0a20
commit f4fc65d234
2 changed files with 6 additions and 3 deletions

View File

@@ -207,14 +207,16 @@ describe("resolveAgentConfig", () => {
expect(result?.workspace).toBe("~/openclaw");
});
it("uses OPENCLAW_HOME for default agent workspace", () => {
// Unix-style paths behave differently on Windows; skip there
it.skipIf(process.platform === "win32")("uses OPENCLAW_HOME for default agent workspace", () => {
vi.stubEnv("OPENCLAW_HOME", "/srv/openclaw-home");
const workspace = resolveAgentWorkspaceDir({} as OpenClawConfig, "main");
expect(workspace).toBe("/srv/openclaw-home/.openclaw/workspace");
});
it("uses OPENCLAW_HOME for default agentDir", () => {
// Unix-style paths behave differently on Windows; skip there
it.skipIf(process.platform === "win32")("uses OPENCLAW_HOME for default agentDir", () => {
vi.stubEnv("OPENCLAW_HOME", "/srv/openclaw-home");
const agentDir = resolveAgentDir({} as OpenClawConfig, "main");

View File

@@ -6,7 +6,8 @@ afterEach(() => {
});
describe("DEFAULT_AGENT_WORKSPACE_DIR", () => {
it("uses OPENCLAW_HOME at module import time", async () => {
// Unix-style paths behave differently on Windows; skip there
it.skipIf(process.platform === "win32")("uses OPENCLAW_HOME at module import time", async () => {
vi.stubEnv("OPENCLAW_HOME", "/srv/openclaw-home");
vi.stubEnv("HOME", "/home/other");
vi.resetModules();