test: tighten web search provider assertions · openclaw/openclaw@b7bdcae
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,12 @@ describe("duckduckgo web search provider", () => {
|
46 | 46 | ]); |
47 | 47 | expect(provider.requiresCredential).toBe(false); |
48 | 48 | expect(provider.credentialPath).toBe(""); |
49 | | -expect(applied.plugins?.entries?.duckduckgo?.enabled).toBe(true); |
| 49 | +const pluginEntry = applied.plugins?.entries?.duckduckgo; |
| 50 | +expect(pluginEntry).toBeDefined(); |
| 51 | +if (!pluginEntry) { |
| 52 | +throw new Error("expected DuckDuckGo plugin entry"); |
| 53 | +} |
| 54 | +expect(pluginEntry.enabled).toBe(true); |
50 | 55 | }); |
51 | 56 | |
52 | 57 | it("maps generic tool arguments into DuckDuckGo search params", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,7 +14,12 @@ describe("exa web search provider", () => {
|
14 | 14 | expect(provider.id).toBe("exa"); |
15 | 15 | expect(provider.onboardingScopes).toEqual(["text-inference"]); |
16 | 16 | expect(provider.credentialPath).toBe("plugins.entries.exa.config.webSearch.apiKey"); |
17 | | -expect(applied.plugins?.entries?.exa?.enabled).toBe(true); |
| 17 | +const pluginEntry = applied.plugins?.entries?.exa; |
| 18 | +expect(pluginEntry).toBeDefined(); |
| 19 | +if (!pluginEntry) { |
| 20 | +throw new Error("expected Exa plugin entry"); |
| 21 | +} |
| 22 | +expect(pluginEntry.enabled).toBe(true); |
18 | 23 | }); |
19 | 24 | |
20 | 25 | it("keeps the lightweight contract surface aligned with provider metadata", () => { |
@@ -39,7 +44,12 @@ describe("exa web search provider", () => {
|
39 | 44 | credentialPath: provider.credentialPath, |
40 | 45 | }); |
41 | 46 | expect(contractProvider.createTool({ config: {}, searchConfig: {} })).toBeNull(); |
42 | | -expect(applied.plugins?.entries?.exa?.enabled).toBe(true); |
| 47 | +const pluginEntry = applied.plugins?.entries?.exa; |
| 48 | +expect(pluginEntry).toBeDefined(); |
| 49 | +if (!pluginEntry) { |
| 50 | +throw new Error("expected contract Exa plugin entry"); |
| 51 | +} |
| 52 | +expect(pluginEntry.enabled).toBe(true); |
43 | 53 | }); |
44 | 54 | |
45 | 55 | it("prefers scoped configured api keys over environment fallbacks", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。