test: stub heavy tools in agent tests
This commit is contained in:
22
src/agents/test-helpers/fast-coding-tools.ts
Normal file
22
src/agents/test-helpers/fast-coding-tools.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
const stubTool = (name: string) => ({
|
||||
name,
|
||||
description: `${name} stub`,
|
||||
parameters: { type: "object", properties: {} },
|
||||
execute: vi.fn(),
|
||||
});
|
||||
|
||||
vi.mock("../tools/image-tool.js", () => ({
|
||||
createImageTool: () => stubTool("image"),
|
||||
}));
|
||||
|
||||
vi.mock("../tools/web-tools.js", () => ({
|
||||
createWebSearchTool: () => null,
|
||||
createWebFetchTool: () => null,
|
||||
}));
|
||||
|
||||
vi.mock("../../plugins/tools.js", () => ({
|
||||
resolvePluginTools: () => [],
|
||||
getPluginToolMeta: () => undefined,
|
||||
}));
|
||||
30
src/agents/test-helpers/fast-core-tools.ts
Normal file
30
src/agents/test-helpers/fast-core-tools.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
const stubTool = (name: string) => ({
|
||||
name,
|
||||
description: `${name} stub`,
|
||||
parameters: { type: "object", properties: {} },
|
||||
execute: vi.fn(),
|
||||
});
|
||||
|
||||
vi.mock("../tools/browser-tool.js", () => ({
|
||||
createBrowserTool: () => stubTool("browser"),
|
||||
}));
|
||||
|
||||
vi.mock("../tools/canvas-tool.js", () => ({
|
||||
createCanvasTool: () => stubTool("canvas"),
|
||||
}));
|
||||
|
||||
vi.mock("../tools/image-tool.js", () => ({
|
||||
createImageTool: () => stubTool("image"),
|
||||
}));
|
||||
|
||||
vi.mock("../tools/web-tools.js", () => ({
|
||||
createWebSearchTool: () => null,
|
||||
createWebFetchTool: () => null,
|
||||
}));
|
||||
|
||||
vi.mock("../../plugins/tools.js", () => ({
|
||||
resolvePluginTools: () => [],
|
||||
getPluginToolMeta: () => undefined,
|
||||
}));
|
||||
Reference in New Issue
Block a user