mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-30 10:10:18 +00:00
test: tighten path prepend casing coverage
This commit is contained in:
@@ -11,6 +11,7 @@ describe("path prepend helpers", () => {
|
||||
it("finds the actual PATH key while preserving original casing", () => {
|
||||
expect(findPathKey({ PATH: "/usr/bin" })).toBe("PATH");
|
||||
expect(findPathKey({ Path: "/usr/bin" })).toBe("Path");
|
||||
expect(findPathKey({ path: "/usr/bin" })).toBe("path");
|
||||
expect(findPathKey({ PaTh: "/usr/bin" })).toBe("PaTh");
|
||||
expect(findPathKey({ HOME: "/tmp" })).toBe("PATH");
|
||||
});
|
||||
@@ -60,6 +61,10 @@ describe("path prepend helpers", () => {
|
||||
applyPathPrepend(envWithoutPath, ["/custom/bin"], { requireExisting: true });
|
||||
expect(envWithoutPath).toEqual({ HOME: "/tmp/home" });
|
||||
|
||||
const envWithBlankPath = { path: "" };
|
||||
applyPathPrepend(envWithBlankPath, ["/custom/bin"], { requireExisting: true });
|
||||
expect(envWithBlankPath).toEqual({ path: "" });
|
||||
|
||||
const envWithPath = { PATH: "/usr/bin" };
|
||||
applyPathPrepend(envWithPath, [], { requireExisting: true });
|
||||
applyPathPrepend(envWithPath, undefined, { requireExisting: true });
|
||||
|
||||
Reference in New Issue
Block a user