mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 22:18:27 +00:00
test: normalize paths in OPENCLAW_HOME tests for cross-platform support (#12212)
* test: normalize paths in OPENCLAW_HOME tests for cross-platform support * test: normalize paths in Nix integration tests for cross-platform support * test: remove unnecessary Windows skip from pi-embedded-runner test * test: fix nix integration tests for path.resolve behavior
This commit is contained in:
@@ -7,15 +7,15 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
describe("DEFAULT_AGENT_WORKSPACE_DIR", () => {
|
||||
// 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");
|
||||
it("uses OPENCLAW_HOME at module import time", async () => {
|
||||
const home = path.join(path.sep, "srv", "openclaw-home");
|
||||
vi.stubEnv("OPENCLAW_HOME", home);
|
||||
vi.stubEnv("HOME", path.join(path.sep, "home", "other"));
|
||||
vi.resetModules();
|
||||
|
||||
const mod = await import("./workspace.js");
|
||||
expect(mod.DEFAULT_AGENT_WORKSPACE_DIR).toBe(
|
||||
path.join(path.resolve("/srv/openclaw-home"), ".openclaw", "workspace"),
|
||||
path.join(path.resolve(home), ".openclaw", "workspace"),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user