From cbde94ea9f08a8a28e35a98398eb2bc357487d19 Mon Sep 17 00:00:00 2001 From: Josh Lehman Date: Thu, 12 Mar 2026 20:50:47 -0700 Subject: [PATCH] test(proxy): isolate uppercase env proxy cases Regeneration-Prompt: | After refreshing dependencies in the PR #35474 prep worktree, the full test suite started failing in src/infra/net/proxy-fetch.test.ts even though the file passed in isolation once the env state was reset correctly. The helper gives lowercase proxy env vars precedence over uppercase ones, even when the lowercase values are explicitly empty, so the uppercase-only test cases must delete the lowercase vars instead of blanking them. Keep runtime code unchanged and tighten only the two affected tests so they model the intended env precedence accurately. --- src/infra/net/proxy-fetch.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/infra/net/proxy-fetch.test.ts b/src/infra/net/proxy-fetch.test.ts index 331cd1ac6ea..6fb0c01dc0d 100644 --- a/src/infra/net/proxy-fetch.test.ts +++ b/src/infra/net/proxy-fetch.test.ts @@ -75,6 +75,8 @@ describe("resolveProxyFetchFromEnv", () => { it("returns proxy fetch using EnvHttpProxyAgent when HTTPS_PROXY is set", async () => { vi.stubEnv("HTTP_PROXY", ""); vi.stubEnv("HTTPS_PROXY", "http://proxy.test:8080"); + delete process.env.https_proxy; + delete process.env.http_proxy; undiciFetch.mockResolvedValue({ ok: true }); const fetchFn = resolveProxyFetchFromEnv(); @@ -91,6 +93,8 @@ describe("resolveProxyFetchFromEnv", () => { it("returns proxy fetch when HTTP_PROXY is set", () => { vi.stubEnv("HTTPS_PROXY", ""); vi.stubEnv("HTTP_PROXY", "http://fallback.test:3128"); + delete process.env.https_proxy; + delete process.env.http_proxy; const fetchFn = resolveProxyFetchFromEnv(); expect(fetchFn).toBeDefined();