Files
openclaw/extensions/browser/src/test-support/browser-security.mock.ts
Jason Zhou bfd540bcdf [codex] refresh plugin regression fixtures
Summary:
- Refresh plugin regression fixtures and test-support mocks for guarded network resolution, progress streaming windows, staged TTS output, QQBot STT, and CLI runner assertions.
- Resolve current-main conflicts in Discord, Google video, QQBot STT, and CLI runner tests without changing runtime code.

Verification:
- pnpm check:test-types
- pnpm vitest run $(git diff --name-only origin/main...HEAD)
- git diff --check
- GitHub CI passed, including Real behavior proof, auto-response, ClawSweeper dispatch, CodeQL, and full CI checks.

Co-authored-by: Jason Zhou <22532527+JayZeeDesign@users.noreply.github.com>
2026-05-10 23:44:50 -05:00

28 lines
999 B
TypeScript

import { vi } from "vitest";
const lookupFn = vi.hoisted(() => async (_hostname: string, options?: { all?: boolean }) => {
const result = { address: "93.184.216.34", family: 4 };
return options?.all === true ? [result] : result;
});
vi.mock("../infra/net/ssrf.js", async () => {
const actual =
await vi.importActual<typeof import("../infra/net/ssrf.js")>("../infra/net/ssrf.js");
return {
...actual,
resolvePinnedHostnameWithPolicy: (hostname: string, params: object = {}) =>
actual.resolvePinnedHostnameWithPolicy(hostname, { ...params, lookupFn: lookupFn as never }),
};
});
vi.mock("../sdk-security-runtime.js", async () => {
const actual = await vi.importActual<typeof import("../sdk-security-runtime.js")>(
"../sdk-security-runtime.js",
);
return {
...actual,
resolvePinnedHostnameWithPolicy: (hostname: string, params: object = {}) =>
actual.resolvePinnedHostnameWithPolicy(hostname, { ...params, lookupFn: lookupFn as never }),
};
});