test: tighten perplexity missing key assertion

This commit is contained in:
Shakker
2026-05-11 00:47:00 +01:00
parent 733e41d495
commit 3bf0d10de3

View File

@@ -20,9 +20,11 @@ describe("perplexity web search provider", () => {
throw new Error("Expected tool definition");
}
await expect(tool.execute({ query: "OpenClaw docs" })).resolves.toMatchObject({
await expect(tool.execute({ query: "OpenClaw docs" })).resolves.toEqual({
error: "missing_perplexity_api_key",
message: expect.stringContaining("use web_fetch for a specific URL or the browser tool"),
message:
"web_search (perplexity) needs an API key. Set PERPLEXITY_API_KEY or OPENROUTER_API_KEY in the Gateway environment, or configure tools.web.search.perplexity.apiKey. If you do not want to configure a search API key, use web_fetch for a specific URL or the browser tool for interactive pages.",
docs: "https://docs.openclaw.ai/tools/web",
});
},
);