mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-07 14:02:55 +00:00
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>
28 lines
999 B
TypeScript
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 }),
|
|
};
|
|
});
|