From a9194f7a671e1f178c79eaf76035f6308773b32d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 14 Mar 2026 00:28:34 +0000 Subject: [PATCH] test: tighten path prepend casing coverage --- src/infra/path-prepend.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/infra/path-prepend.test.ts b/src/infra/path-prepend.test.ts index 7f4211a0137..a0ad172e326 100644 --- a/src/infra/path-prepend.test.ts +++ b/src/infra/path-prepend.test.ts @@ -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 });