mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 18:44:31 +00:00
test: make shell-env cache assertions windows-safe
This commit is contained in:
@@ -87,6 +87,13 @@ describe("shell env fallback", () => {
|
|||||||
exec: exec as unknown as Parameters<typeof getShellPathFromLoginShell>[0]["exec"],
|
exec: exec as unknown as Parameters<typeof getShellPathFromLoginShell>[0]["exec"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
expect(first).toBeNull();
|
||||||
|
expect(second).toBeNull();
|
||||||
|
expect(exec).not.toHaveBeenCalled();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
expect(first).toBe("/usr/local/bin:/usr/bin");
|
expect(first).toBe("/usr/local/bin:/usr/bin");
|
||||||
expect(second).toBe("/usr/local/bin:/usr/bin");
|
expect(second).toBe("/usr/local/bin:/usr/bin");
|
||||||
expect(exec).toHaveBeenCalledOnce();
|
expect(exec).toHaveBeenCalledOnce();
|
||||||
@@ -109,6 +116,10 @@ describe("shell env fallback", () => {
|
|||||||
|
|
||||||
expect(first).toBeNull();
|
expect(first).toBeNull();
|
||||||
expect(second).toBeNull();
|
expect(second).toBeNull();
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
expect(exec).not.toHaveBeenCalled();
|
||||||
|
return;
|
||||||
|
}
|
||||||
expect(exec).toHaveBeenCalledOnce();
|
expect(exec).toHaveBeenCalledOnce();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user