test: tighten web search provider assertions

This commit is contained in:
Shakker
2026-05-08 18:58:18 +01:00
parent 45f3ec2ead
commit b7bdcaeb88
2 changed files with 18 additions and 3 deletions

View File

@@ -46,7 +46,12 @@ describe("duckduckgo web search provider", () => {
]);
expect(provider.requiresCredential).toBe(false);
expect(provider.credentialPath).toBe("");
expect(applied.plugins?.entries?.duckduckgo?.enabled).toBe(true);
const pluginEntry = applied.plugins?.entries?.duckduckgo;
expect(pluginEntry).toBeDefined();
if (!pluginEntry) {
throw new Error("expected DuckDuckGo plugin entry");
}
expect(pluginEntry.enabled).toBe(true);
});
it("maps generic tool arguments into DuckDuckGo search params", async () => {

View File

@@ -14,7 +14,12 @@ describe("exa web search provider", () => {
expect(provider.id).toBe("exa");
expect(provider.onboardingScopes).toEqual(["text-inference"]);
expect(provider.credentialPath).toBe("plugins.entries.exa.config.webSearch.apiKey");
expect(applied.plugins?.entries?.exa?.enabled).toBe(true);
const pluginEntry = applied.plugins?.entries?.exa;
expect(pluginEntry).toBeDefined();
if (!pluginEntry) {
throw new Error("expected Exa plugin entry");
}
expect(pluginEntry.enabled).toBe(true);
});
it("keeps the lightweight contract surface aligned with provider metadata", () => {
@@ -39,7 +44,12 @@ describe("exa web search provider", () => {
credentialPath: provider.credentialPath,
});
expect(contractProvider.createTool({ config: {}, searchConfig: {} })).toBeNull();
expect(applied.plugins?.entries?.exa?.enabled).toBe(true);
const pluginEntry = applied.plugins?.entries?.exa;
expect(pluginEntry).toBeDefined();
if (!pluginEntry) {
throw new Error("expected contract Exa plugin entry");
}
expect(pluginEntry.enabled).toBe(true);
});
it("prefers scoped configured api keys over environment fallbacks", () => {