test: tighten provider empty array assertions

This commit is contained in:
Shakker
2026-05-09 04:55:16 +01:00
parent 21d758c644
commit 84c4a4fc5b
10 changed files with 17 additions and 17 deletions
@@ -263,7 +263,7 @@ describe("bedrock mantle discovery", () => {
fetchFn: mockFetch as unknown as typeof fetch,
});
expect(models).toEqual([]);
expect(models).toStrictEqual([]);
});
it("returns empty array on network error", async () => {
@@ -275,7 +275,7 @@ describe("bedrock mantle discovery", () => {
fetchFn: mockFetch as unknown as typeof fetch,
});
expect(models).toEqual([]);
expect(models).toStrictEqual([]);
});
it("filters out models with empty IDs", async () => {
+1 -1
View File
@@ -11,7 +11,7 @@ describe("deepinfra augmentModelCatalog", () => {
const entries = await provider.augmentModelCatalog?.({} as never);
expect(entries).toEqual([]);
expect(entries).toStrictEqual([]);
});
it("returns configured catalog entries from config", async () => {
+1 -1
View File
@@ -66,7 +66,7 @@ describe("discoverDeepInfraModels", () => {
expect(DEEPINFRA_DEFAULT_MODEL_REF).toBe("deepinfra/deepseek-ai/DeepSeek-V3.2");
expect(modelIds).toContain("deepseek-ai/DeepSeek-V3.2");
expect(streamingUsageIncompatibleModelIds).toEqual([]);
expect(streamingUsageIncompatibleModelIds).toStrictEqual([]);
});
it("fetches DeepInfra's curated LLM catalog and parses model metadata", async () => {
+2 -2
View File
@@ -128,8 +128,8 @@ describe("Gemini embedding provider", () => {
fallback: "none",
});
await expect(provider.embedQuery(" ")).resolves.toEqual([]);
await expect(provider.embedBatch([])).resolves.toEqual([]);
await expect(provider.embedQuery(" ")).resolves.toStrictEqual([]);
await expect(provider.embedBatch([])).resolves.toStrictEqual([]);
await expect(provider.embedQuery("test query")).resolves.toEqual([0.6, 0.8, 0]);
const structuredBatch = await provider.embedBatchInputs?.([
+1 -1
View File
@@ -138,7 +138,7 @@ describe("google provider plugin hooks", () => {
provider: "google-gemini-cli",
tools: [tool],
} as never),
).toEqual([]);
).toStrictEqual([]);
});
it("wires google-thinking stream hooks for direct and Gemini CLI providers", async () => {
+3 -3
View File
@@ -731,7 +731,7 @@ describe("convertToOllamaMessages", () => {
it("handles empty messages array", () => {
const result = convertToOllamaMessages([]);
expect(result).toEqual([]);
expect(result).toStrictEqual([]);
});
});
@@ -1285,9 +1285,9 @@ describe("createOllamaStreamFn streaming events", () => {
// start/text_start carry empty partials (before any content accumulates)
const startEvent = events.find((e) => e.type === "start");
expect(startEvent?.partial.content).toEqual([]);
expect(startEvent?.partial.content).toStrictEqual([]);
const textStartEvent = events.find((e) => e.type === "text_start");
expect(textStartEvent?.partial.content).toEqual([]);
expect(textStartEvent?.partial.content).toStrictEqual([]);
// text_delta partials accumulate content progressively
expect(deltas[0].partial.content).toEqual([{ type: "text", text: "Hello" }]);
+2 -2
View File
@@ -386,7 +386,7 @@ describe("openai plugin", () => {
} as never,
tools: [noParamsTool],
} as never),
).toEqual([]);
).toStrictEqual([]);
expect(
codexProvider.inspectToolSchemas?.({
provider: "openai-codex",
@@ -400,7 +400,7 @@ describe("openai plugin", () => {
} as never,
tools: [noParamsTool],
} as never),
).toEqual([]);
).toStrictEqual([]);
});
it("registers GPT-5 system prompt contributions when the friendly overlay is enabled", async () => {
@@ -34,6 +34,6 @@ describe("opencode provider policy public artifact", () => {
levels: expect.arrayContaining([{ id: "adaptive" }]),
defaultLevel: "adaptive",
});
expect(collectLegacyExtendedLevelIds(profile.levels)).toEqual([]);
expect(collectLegacyExtendedLevelIds(profile.levels)).toStrictEqual([]);
});
});
@@ -59,7 +59,7 @@ describe("vercel ai gateway thinking profile", () => {
levels: expect.arrayContaining([{ id: "adaptive" }]),
defaultLevel: "adaptive",
});
expect(collectLegacyExtendedLevelIds(profile?.levels)).toEqual([]);
expect(collectLegacyExtendedLevelIds(profile?.levels)).toStrictEqual([]);
});
it("falls through for unsupported OpenAI or untrusted namespaced refs", async () => {
+3 -3
View File
@@ -385,7 +385,7 @@ describe("xai web search response parsing", () => {
],
});
expect(result.text).toBe("hello from output");
expect(result.annotationCitations).toEqual([]);
expect(result.annotationCitations).toStrictEqual([]);
});
it("extracts url_citation annotations from content blocks", () => {
@@ -414,13 +414,13 @@ describe("xai web search response parsing", () => {
it("falls back to deprecated output_text", () => {
const result = extractXaiWebSearchContent({ output_text: "hello from output_text" });
expect(result.text).toBe("hello from output_text");
expect(result.annotationCitations).toEqual([]);
expect(result.annotationCitations).toStrictEqual([]);
});
it("returns undefined text when no content found", () => {
const result = extractXaiWebSearchContent({});
expect(result.text).toBeUndefined();
expect(result.annotationCitations).toEqual([]);
expect(result.annotationCitations).toStrictEqual([]);
});
it("extracts output_text blocks directly in output array", () => {