Skip to content

test(providers): cover Gemini speech support and HuggingFace error handling gaps#588

Merged
aaight merged 1 commit intodevfrom
feat/unit-tests-gemini-huggingface-gaps
Apr 18, 2026
Merged

test(providers): cover Gemini speech support and HuggingFace error handling gaps#588
aaight merged 1 commit intodevfrom
feat/unit-tests-gemini-huggingface-gaps

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Apr 18, 2026

Summary

Adds unit tests to close coverage gaps in the Gemini and HuggingFace provider adapters.

  • Gemini (gemini.test.ts): tests for supportsSpeechGeneration (lines 360-362) and buildApiRequest (lines 429-442)
  • HuggingFace (huggingface.test.ts): tests for DeepSeek reasoning injection (lines 67-72) and enhanceError with non-Error values (lines 82-83)

Closes https://linear.app/mongrel/issue/MNG-266

Changes

  • packages/llmist/src/providers/gemini.test.ts: Added describe("supportsSpeechGeneration") block (returns true for known TTS models, false for others) and describe("buildApiRequest") block (message conversion, option passthrough, content verification)
  • packages/llmist/src/providers/huggingface.test.ts: Added 3 tests for DeepSeek thinking-mode injection (enabled, disabled, non-DeepSeek) and 1 test for enhanceError with non-Error input types

Test plan

  • npm run test passes — all 6537 tests pass (219 test files)
  • npx biome check on changed files — no errors (only pre-existing any warnings consistent with rest of test suite)
  • No production code changes — test-only PR

🕵️ claude-code · claude-sonnet-4-6 · run details

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Tests correctly exercise the targeted coverage gaps: Gemini supportsSpeechGeneration dispatches to isGeminiSpeechModel, buildApiRequest message conversion and option passthrough, HuggingFace DeepSeek thinking-mode injection logic, and enhanceError non-Error coercion path. All assertions align with the actual implementation. CI green.

🕵️ claude-code · claude-opus-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Clean test-only PR that correctly covers the targeted gaps: Gemini supportsSpeechGeneration delegation, buildApiRequest message conversion/option passthrough, HuggingFace DeepSeek thinking-mode injection (enabled, disabled, non-DeepSeek), and enhanceError non-Error coercion. All assertions verified against the source implementations. CI green.

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit 64a4a31 into dev Apr 18, 2026
5 checks passed
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.

3 participants