mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:40:42 +00:00
test: drop redundant web search registration smokes
This commit is contained in:
@@ -64,39 +64,6 @@ describe("tavily tools", () => {
|
||||
expect(applied.plugins?.entries?.tavily?.enabled).toBe(true);
|
||||
});
|
||||
|
||||
it("registers web search provider and two tools", () => {
|
||||
const registrations: {
|
||||
webSearchProviders: unknown[];
|
||||
tools: unknown[];
|
||||
} = { webSearchProviders: [], tools: [] };
|
||||
|
||||
const mockApi = {
|
||||
registerWebSearchProvider(provider: unknown) {
|
||||
registrations.webSearchProviders.push(provider);
|
||||
},
|
||||
registerTool(tool: unknown) {
|
||||
registrations.tools.push(tool);
|
||||
},
|
||||
config: {},
|
||||
};
|
||||
|
||||
plugin.register(mockApi as never);
|
||||
|
||||
expect(plugin.id).toBe("tavily");
|
||||
expect(plugin.name).toBe("Tavily Plugin");
|
||||
expect(registrations.webSearchProviders).toHaveLength(1);
|
||||
expect(registrations.tools).toHaveLength(2);
|
||||
|
||||
const provider = registrations.webSearchProviders[0] as Record<string, unknown>;
|
||||
expect(provider.id).toBe("tavily");
|
||||
expect(provider.autoDetectOrder).toBe(70);
|
||||
expect(provider.envVars).toEqual(["TAVILY_API_KEY"]);
|
||||
|
||||
const toolNames = registrations.tools.map((t) => (t as Record<string, unknown>).name);
|
||||
expect(toolNames).toContain("tavily_search");
|
||||
expect(toolNames).toContain("tavily_extract");
|
||||
});
|
||||
|
||||
it("maps generic provider args into Tavily search params", async () => {
|
||||
const provider = createTavilyWebSearchProvider();
|
||||
const tool = provider.createTool({
|
||||
|
||||
Reference in New Issue
Block a user