mirror of https://github.com/openclaw/openclaw.git
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.
This commit is contained in:
parent
57af5fccce
commit
cbde94ea9f
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Reference in New Issue