mirror of https://github.com/openclaw/openclaw.git
test: isolate browser navigation tests from host proxy env
This commit is contained in:
parent
8746e2e216
commit
e8b0d57eb6
|
|
@ -1,4 +1,4 @@
|
|||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { SsrFBlockedError, type LookupFn } from "../infra/net/ssrf.js";
|
||||
import {
|
||||
assertBrowserNavigationAllowed,
|
||||
|
|
@ -13,7 +13,22 @@ function createLookupFn(address: string): LookupFn {
|
|||
return vi.fn(async () => [{ address, family }]) as unknown as LookupFn;
|
||||
}
|
||||
|
||||
const PROXY_ENV_KEYS = [
|
||||
"HTTP_PROXY",
|
||||
"HTTPS_PROXY",
|
||||
"ALL_PROXY",
|
||||
"http_proxy",
|
||||
"https_proxy",
|
||||
"all_proxy",
|
||||
] as const;
|
||||
|
||||
describe("browser navigation guard", () => {
|
||||
beforeEach(() => {
|
||||
for (const key of PROXY_ENV_KEYS) {
|
||||
vi.stubEnv(key, "");
|
||||
}
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllEnvs();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue