test: tighten provider empty array assertions · openclaw/openclaw@84c4a4f
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -263,7 +263,7 @@ describe("bedrock mantle discovery", () => {
|
263 | 263 | fetchFn: mockFetch as unknown as typeof fetch, |
264 | 264 | }); |
265 | 265 | |
266 | | -expect(models).toEqual([]); |
| 266 | +expect(models).toStrictEqual([]); |
267 | 267 | }); |
268 | 268 | |
269 | 269 | it("returns empty array on network error", async () => { |
@@ -275,7 +275,7 @@ describe("bedrock mantle discovery", () => {
|
275 | 275 | fetchFn: mockFetch as unknown as typeof fetch, |
276 | 276 | }); |
277 | 277 | |
278 | | -expect(models).toEqual([]); |
| 278 | +expect(models).toStrictEqual([]); |
279 | 279 | }); |
280 | 280 | |
281 | 281 | it("filters out models with empty IDs", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -11,7 +11,7 @@ describe("deepinfra augmentModelCatalog", () => {
|
11 | 11 | |
12 | 12 | const entries = await provider.augmentModelCatalog?.({} as never); |
13 | 13 | |
14 | | -expect(entries).toEqual([]); |
| 14 | +expect(entries).toStrictEqual([]); |
15 | 15 | }); |
16 | 16 | |
17 | 17 | it("returns configured catalog entries from config", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -66,7 +66,7 @@ describe("discoverDeepInfraModels", () => {
|
66 | 66 | |
67 | 67 | expect(DEEPINFRA_DEFAULT_MODEL_REF).toBe("deepinfra/deepseek-ai/DeepSeek-V3.2"); |
68 | 68 | expect(modelIds).toContain("deepseek-ai/DeepSeek-V3.2"); |
69 | | -expect(streamingUsageIncompatibleModelIds).toEqual([]); |
| 69 | +expect(streamingUsageIncompatibleModelIds).toStrictEqual([]); |
70 | 70 | }); |
71 | 71 | |
72 | 72 | it("fetches DeepInfra's curated LLM catalog and parses model metadata", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -128,8 +128,8 @@ describe("Gemini embedding provider", () => {
|
128 | 128 | fallback: "none", |
129 | 129 | }); |
130 | 130 | |
131 | | -await expect(provider.embedQuery(" ")).resolves.toEqual([]); |
132 | | -await expect(provider.embedBatch([])).resolves.toEqual([]); |
| 131 | +await expect(provider.embedQuery(" ")).resolves.toStrictEqual([]); |
| 132 | +await expect(provider.embedBatch([])).resolves.toStrictEqual([]); |
133 | 133 | await expect(provider.embedQuery("test query")).resolves.toEqual([0.6, 0.8, 0]); |
134 | 134 | |
135 | 135 | const structuredBatch = await provider.embedBatchInputs?.([ |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -138,7 +138,7 @@ describe("google provider plugin hooks", () => {
|
138 | 138 | provider: "google-gemini-cli", |
139 | 139 | tools: [tool], |
140 | 140 | } as never), |
141 | | -).toEqual([]); |
| 141 | +).toStrictEqual([]); |
142 | 142 | }); |
143 | 143 | |
144 | 144 | it("wires google-thinking stream hooks for direct and Gemini CLI providers", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -731,7 +731,7 @@ describe("convertToOllamaMessages", () => {
|
731 | 731 | |
732 | 732 | it("handles empty messages array", () => { |
733 | 733 | const result = convertToOllamaMessages([]); |
734 | | -expect(result).toEqual([]); |
| 734 | +expect(result).toStrictEqual([]); |
735 | 735 | }); |
736 | 736 | }); |
737 | 737 | |
@@ -1285,9 +1285,9 @@ describe("createOllamaStreamFn streaming events", () => {
|
1285 | 1285 | |
1286 | 1286 | // start/text_start carry empty partials (before any content accumulates) |
1287 | 1287 | const startEvent = events.find((e) => e.type === "start"); |
1288 | | -expect(startEvent?.partial.content).toEqual([]); |
| 1288 | +expect(startEvent?.partial.content).toStrictEqual([]); |
1289 | 1289 | const textStartEvent = events.find((e) => e.type === "text_start"); |
1290 | | -expect(textStartEvent?.partial.content).toEqual([]); |
| 1290 | +expect(textStartEvent?.partial.content).toStrictEqual([]); |
1291 | 1291 | |
1292 | 1292 | // text_delta partials accumulate content progressively |
1293 | 1293 | expect(deltas[0].partial.content).toEqual([{ type: "text", text: "Hello" }]); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -386,7 +386,7 @@ describe("openai plugin", () => {
|
386 | 386 | } as never, |
387 | 387 | tools: [noParamsTool], |
388 | 388 | } as never), |
389 | | -).toEqual([]); |
| 389 | +).toStrictEqual([]); |
390 | 390 | expect( |
391 | 391 | codexProvider.inspectToolSchemas?.({ |
392 | 392 | provider: "openai-codex", |
@@ -400,7 +400,7 @@ describe("openai plugin", () => {
|
400 | 400 | } as never, |
401 | 401 | tools: [noParamsTool], |
402 | 402 | } as never), |
403 | | -).toEqual([]); |
| 403 | +).toStrictEqual([]); |
404 | 404 | }); |
405 | 405 | |
406 | 406 | it("registers GPT-5 system prompt contributions when the friendly overlay is enabled", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,6 @@ describe("opencode provider policy public artifact", () => {
|
34 | 34 | levels: expect.arrayContaining([{ id: "adaptive" }]), |
35 | 35 | defaultLevel: "adaptive", |
36 | 36 | }); |
37 | | -expect(collectLegacyExtendedLevelIds(profile.levels)).toEqual([]); |
| 37 | +expect(collectLegacyExtendedLevelIds(profile.levels)).toStrictEqual([]); |
38 | 38 | }); |
39 | 39 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -59,7 +59,7 @@ describe("vercel ai gateway thinking profile", () => {
|
59 | 59 | levels: expect.arrayContaining([{ id: "adaptive" }]), |
60 | 60 | defaultLevel: "adaptive", |
61 | 61 | }); |
62 | | -expect(collectLegacyExtendedLevelIds(profile?.levels)).toEqual([]); |
| 62 | +expect(collectLegacyExtendedLevelIds(profile?.levels)).toStrictEqual([]); |
63 | 63 | }); |
64 | 64 | |
65 | 65 | it("falls through for unsupported OpenAI or untrusted namespaced refs", async () => { |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -385,7 +385,7 @@ describe("xai web search response parsing", () => {
|
385 | 385 | ], |
386 | 386 | }); |
387 | 387 | expect(result.text).toBe("hello from output"); |
388 | | -expect(result.annotationCitations).toEqual([]); |
| 388 | +expect(result.annotationCitations).toStrictEqual([]); |
389 | 389 | }); |
390 | 390 | |
391 | 391 | it("extracts url_citation annotations from content blocks", () => { |
@@ -414,13 +414,13 @@ describe("xai web search response parsing", () => {
|
414 | 414 | it("falls back to deprecated output_text", () => { |
415 | 415 | const result = extractXaiWebSearchContent({ output_text: "hello from output_text" }); |
416 | 416 | expect(result.text).toBe("hello from output_text"); |
417 | | -expect(result.annotationCitations).toEqual([]); |
| 417 | +expect(result.annotationCitations).toStrictEqual([]); |
418 | 418 | }); |
419 | 419 | |
420 | 420 | it("returns undefined text when no content found", () => { |
421 | 421 | const result = extractXaiWebSearchContent({}); |
422 | 422 | expect(result.text).toBeUndefined(); |
423 | | -expect(result.annotationCitations).toEqual([]); |
| 423 | +expect(result.annotationCitations).toStrictEqual([]); |
424 | 424 | }); |
425 | 425 | |
426 | 426 | it("extracts output_text blocks directly in output array", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。