test: tighten provider config helper assertions · openclaw/openclaw@92c702b
steipete
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -79,7 +79,6 @@ describe("chutes-models", () => {
|
79 | 79 | expect(def.cost).toEqual(entry.cost); |
80 | 80 | expect(def.contextWindow).toBe(entry.contextWindow); |
81 | 81 | expect(def.maxTokens).toBe(entry.maxTokens); |
82 | | -expect(def.compat).toBeDefined(); |
83 | 82 | if (!def.compat) { |
84 | 83 | throw new Error("expected Chutes model compat"); |
85 | 84 | } |
@@ -124,7 +123,6 @@ describe("chutes-models", () => {
|
124 | 123 | const secondModel = requireChutesModel(models, 1); |
125 | 124 | expect(firstModel.id).toBe("zai-org/GLM-4.7-TEE"); |
126 | 125 | expect(secondModel.reasoning).toBe(true); |
127 | | -expect(secondModel.compat).toBeDefined(); |
128 | 126 | if (!secondModel.compat) { |
129 | 127 | throw new Error("expected Chutes API model compat"); |
130 | 128 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -6,7 +6,6 @@ import plugin from "./index.js";
|
6 | 6 | function registerProvider() { |
7 | 7 | const captured = capturePluginRegistration(plugin); |
8 | 8 | const provider = captured.providers[0]; |
9 | | -expect(provider).toBeDefined(); |
10 | 9 | if (!provider) { |
11 | 10 | throw new Error("expected Cloudflare AI Gateway provider"); |
12 | 11 | } |
@@ -53,7 +52,6 @@ describe("cloudflare-ai-gateway plugin", () => {
|
53 | 52 | {}, |
54 | 53 | ); |
55 | 54 | |
56 | | -expect(capturedPayload).toBeDefined(); |
57 | 55 | if (!capturedPayload) { |
58 | 56 | throw new Error("expected Cloudflare AI Gateway payload capture"); |
59 | 57 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -15,7 +15,6 @@ describe("exa web search provider", () => {
|
15 | 15 | expect(provider.onboardingScopes).toEqual(["text-inference"]); |
16 | 16 | expect(provider.credentialPath).toBe("plugins.entries.exa.config.webSearch.apiKey"); |
17 | 17 | const pluginEntry = applied.plugins?.entries?.exa; |
18 | | -expect(pluginEntry).toBeDefined(); |
19 | 18 | if (!pluginEntry) { |
20 | 19 | throw new Error("expected Exa plugin entry"); |
21 | 20 | } |
@@ -45,7 +44,6 @@ describe("exa web search provider", () => {
|
45 | 44 | }); |
46 | 45 | expect(contractProvider.createTool({ config: {}, searchConfig: {} })).toBeNull(); |
47 | 46 | const pluginEntry = applied.plugins?.entries?.exa; |
48 | | -expect(pluginEntry).toBeDefined(); |
49 | 47 | if (!pluginEntry) { |
50 | 48 | throw new Error("expected contract Exa plugin entry"); |
51 | 49 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -48,7 +48,6 @@ describe("fireworks provider plugin", () => {
|
48 | 48 | expect(provider.aliases).toEqual(["fireworks-ai"]); |
49 | 49 | expect(provider.envVars).toEqual(["FIREWORKS_API_KEY"]); |
50 | 50 | expect(provider.auth).toHaveLength(1); |
51 | | -expect(resolved).toBeDefined(); |
52 | 51 | if (!resolved) { |
53 | 52 | throw new Error("expected Fireworks api-key auth choice"); |
54 | 53 | } |
@@ -63,7 +62,6 @@ describe("fireworks provider plugin", () => {
|
63 | 62 | expect(catalogProvider.api).toBe("openai-completions"); |
64 | 63 | expect(catalogProvider.baseUrl).toBe(FIREWORKS_BASE_URL); |
65 | 64 | const models = catalogProvider.models; |
66 | | -expect(models).toBeDefined(); |
67 | 65 | if (!models) { |
68 | 66 | throw new Error("expected Fireworks catalog models"); |
69 | 67 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -10,7 +10,6 @@ import {
|
10 | 10 | type QwenProvider = ReturnType<typeof buildQwenProvider>; |
11 | 11 | |
12 | 12 | function getQwenModelIds(provider: QwenProvider): string[] { |
13 | | -expect(provider.models).toBeDefined(); |
14 | 13 | return provider.models.map((model) => model.id); |
15 | 14 | } |
16 | 15 | |
@@ -43,7 +42,6 @@ describe("qwen provider catalog", () => {
|
43 | 42 | expect(nativeProvider.models.length).toBeGreaterThan(0); |
44 | 43 | expect( |
45 | 44 | nativeProvider.models.every((model) => { |
46 | | -expect(model.compat).toBeDefined(); |
47 | 45 | if (!model.compat) { |
48 | 46 | throw new Error(`expected Qwen model ${model.id} compat`); |
49 | 47 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -51,7 +51,6 @@ function makePrompter(confirmValue: boolean): DoctorPrompter {
|
51 | 51 | } |
52 | 52 | |
53 | 53 | function requireAuthConfig(config: OpenClawConfig): NonNullable<OpenClawConfig["auth"]> { |
54 | | -expect(config.auth).toBeDefined(); |
55 | 54 | if (!config.auth) { |
56 | 55 | throw new Error("expected repaired auth config"); |
57 | 56 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -85,7 +85,6 @@ async function readPersistedJobs(storePath: string): Promise<Array<Record<string
|
85 | 85 | |
86 | 86 | function requirePersistedJob(jobs: Array<Record<string, unknown>>, index: number) { |
87 | 87 | const job = jobs[index]; |
88 | | -expect(job).toBeDefined(); |
89 | 88 | if (!job) { |
90 | 89 | throw new Error(`expected persisted cron job ${index}`); |
91 | 90 | } |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -36,7 +36,6 @@ async function loadProviderRegistry() {
|
36 | 36 | |
37 | 37 | function requireImageProvider(id: string): ImageGenerationProviderPlugin { |
38 | 38 | const provider = getImageGenerationProvider(id); |
39 | | -expect(provider).toBeDefined(); |
40 | 39 | if (!provider) { |
41 | 40 | throw new Error(`expected image generation provider ${id}`); |
42 | 41 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。