Skip to content

tests: add unit tests for ZAIProvider with mocked client: [#2983]#3029

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

tests: add unit tests for ZAIProvider with mocked client: [#2983]#3029
Salazareo merged 2 commits into
mainfrom
DS/DS/2983

Conversation

@Salazareo
Copy link
Copy Markdown
Member

Adds offline ZAIProvider.test.ts covering construction, model resolution and aliasing, GLM-specific request shape (custom params, cache_control stripping, user_id derivation, stream_options gating), non-stream output with reasoning_content normalisation, streaming deltas (text and tool_use), error mapping, and metering. Existing integration test is left untouched.

Adds offline ZAIProvider.test.ts covering construction, model
resolution and aliasing, GLM-specific request shape (custom params,
cache_control stripping, user_id derivation, stream_options gating),
non-stream output with reasoning_content normalisation, streaming
deltas (text and tool_use), 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.49%
⬆️ +0.23%
6626 / 17671
🔵 Statements 36.74%
⬆️ +0.22%
6999 / 19047
🔵 Functions 39.61%
⬆️ +0.43%
1183 / 2986
🔵 Branches 26.34%
⬆️ +0.36%
3695 / 14026
File CoverageNo changed files found.
Generated in workflow #90 for commit f0f4d04 by the Vitest Coverage Report Action

Drops the local makeMeteringStub in favour of a live PuterServer-wired
MeteringService. The OpenAI SDK is still mocked at the module boundary
(the real network egress point); everything else — config, Context,
metering recording — 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 1c188d6 into main May 9, 2026
4 checks passed
@Salazareo Salazareo deleted the DS/DS/2983 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