openclaw/src/agents/tools/web-fetch.test-mocks.ts
2026-02-16 14:59:30 +00:00

15 lines
421 B
TypeScript

import { vi } from "vitest";
// Avoid dynamic-importing heavy readability deps in unit test suites.
vi.mock("./web-fetch-utils.js", async () => {
const actual =
await vi.importActual<typeof import("./web-fetch-utils.js")>("./web-fetch-utils.js");
return {
...actual,
extractReadableContent: vi.fn().mockResolvedValue({
title: "HTML Page",
text: "HTML Page\n\nContent here.",
}),
};
});