test: make shell-env cache assertions windows-safe

This commit is contained in:
Peter Steinberger
2026-02-18 21:51:08 +00:00
parent b62bd290cb
commit 48b0b55fa4

View File

@@ -87,6 +87,13 @@ describe("shell env fallback", () => {
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(second).toBe("/usr/local/bin:/usr/bin");
expect(exec).toHaveBeenCalledOnce();
@@ -109,6 +116,10 @@ describe("shell env fallback", () => {
expect(first).toBeNull();
expect(second).toBeNull();
if (process.platform === "win32") {
expect(exec).not.toHaveBeenCalled();
return;
}
expect(exec).toHaveBeenCalledOnce();
});
});