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 });