mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-18 16:08:56 +00:00
* fix(engine): downloads refuse hosts that resolve to private addresses * fix(core): shorten the env proxy doc comment * test(producer): remote-media tests stub the download fetch seam
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { envProxyEnabled, fetchGoesThroughEnvProxy } from "./envProxy.js";
|
|
|
|
describe("env proxy", () => {
|
|
it("needs a proxy variable and Node started with env-proxy support", () => {
|
|
const proxy = { HTTPS_PROXY: "http://proxy.test:3128" };
|
|
expect(fetchGoesThroughEnvProxy({ ...proxy, NODE_USE_ENV_PROXY: "1" }, [])).toBe(true);
|
|
expect(fetchGoesThroughEnvProxy(proxy, ["--use-env-proxy"])).toBe(true);
|
|
expect(
|
|
fetchGoesThroughEnvProxy({ ...proxy, NODE_OPTIONS: "--no-warnings --use-env-proxy" }, []),
|
|
).toBe(true);
|
|
expect(
|
|
fetchGoesThroughEnvProxy({ https_proxy: " http://proxy.test ", NODE_USE_ENV_PROXY: "1" }, []),
|
|
).toBe(true);
|
|
expect(fetchGoesThroughEnvProxy(proxy, [])).toBe(false);
|
|
expect(fetchGoesThroughEnvProxy({ NODE_USE_ENV_PROXY: "1" }, [])).toBe(false);
|
|
expect(fetchGoesThroughEnvProxy({ HTTPS_PROXY: " ", NODE_USE_ENV_PROXY: "1" }, [])).toBe(false);
|
|
});
|
|
|
|
it("reports env-proxy support separately from the variables", () => {
|
|
expect(envProxyEnabled({ NODE_USE_ENV_PROXY: "1" }, [])).toBe(true);
|
|
expect(envProxyEnabled({}, [])).toBe(false);
|
|
});
|
|
});
|