Skip to content

tests: add unit tests for MistralAiProvider with mocked client: [#2978]#3032

Merged
Salazareo merged 2 commits into
mainfrom
DS/DS/2978
May 9, 2026
Merged

tests: add unit tests for MistralAiProvider with mocked client: [#2978]#3032
Salazareo merged 2 commits into
mainfrom
DS/DS/2978

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Adds offline MistralAiProvider.test.ts covering construction, model resolution and aliasing, request shape (camelCase maxTokens, tool_calls → toolCalls and tool_call_id → toolCallId rewrite, complete-vs-stream routing), non-stream output with the camelCase usage coercion, streaming with the chunk.data unwrap and toolCalls deviation, error mapping, and metering. Existing integration test is left untouched.

Adds offline MistralAiProvider.test.ts covering construction, model
resolution and aliasing, request shape (camelCase maxTokens, tool_calls
→ toolCalls and tool_call_id → toolCallId rewrite, complete-vs-stream
routing), non-stream output with the camelCase usage coercion,
streaming with the chunk.data unwrap and toolCalls deviation, error
mapping, and metering. Existing integration test is left untouched.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 9, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 37.48%
⬆️ +0.22%
6624 / 17671
🔵 Statements 36.73%
⬆️ +0.21%
6996 / 19047
🔵 Functions 39.65%
⬆️ +0.47%
1184 / 2986
🔵 Branches 26.06%
⬆️ +0.08%
3656 / 14026
File CoverageNo changed files found.
Generated in workflow #91 for commit 0139631 by the Vitest Coverage Report Action

Drops the local makeMeteringStub in favour of a live PuterServer-wired
MeteringService. The Mistral SDK is still mocked at the module
boundary (the real network egress point); everything else runs through
the real wired graph. Aligns with AGENTS.md: "Prefer test server over
mocking deps."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Salazareo Salazareo merged commit 6ab2a2a into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/DS/2978 branch May 10, 2026 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant