Skip to content

Conversation

@dancer
Copy link
Collaborator

@dancer dancer commented Feb 11, 2026

background

part of the ongoing effort to normalize provider tests to use recorded api fixtures (#12270)

summary

  • recorded fixtures from real groq api using latest models (llama-3.3-70b-versatile for text/tool-call, qwen/qwen3-32b for reasoning)
  • replaced inline prepareJsonResponse/prepareStreamResponse helpers with prepareJsonFixtureResponse/prepareChunksFixtureResponse that read from __fixtures__/
  • added fixture-based snapshot tests for text, tool call, and reasoning (both doGenerate and doStream)
  • preserved all edge case tests inline (partial usage, cached tokens, unknown finish reason, structured outputs variants, error streams, unparsable streams, raw chunks, tool call in one chunk, duplicate tool call prevention)
  • added required standalone tests (response headers for doGenerate + doStream, usage extraction, response metadata)
  • replaced all toStrictEqual assertions with toMatchInlineSnapshot()

verification

tests pass
$ pnpm test

 ✓ src/convert-groq-usage.test.ts  (9 tests) 3ms
 ✓ src/groq-chat-options.test.ts  (8 tests) 4ms
 ✓ src/groq-prepare-tools.test.ts  (13 tests) 11ms
 ✓ src/convert-to-groq-chat-messages.test.ts  (6 tests) 9ms
 ✓ src/groq-transcription-model.test.ts  (6 tests) 36ms
 ✓ src/groq-chat-language-model.test.ts  (36 tests) 122ms

 Test Files  6 passed (6)
      Tests  78 passed (78)
no old helpers or toStrictEqual remaining
$ grep -c 'prepareJsonResponse\|prepareStreamResponse\|toStrictEqual' packages/groq/src/groq-chat-language-model.test.ts
0

checklist

  • tests have been added / updated (for bug fixes / features)
  • documentation has been added / updated (for bug fixes / features)
  • a patch changeset for relevant packages has been added (run pnpm changeset in root)
  • i have reviewed this pull request (self-review)

related issues

part of #12270

@gr2m gr2m merged commit ef757a4 into main Feb 11, 2026
25 checks passed
@gr2m gr2m deleted the josh/groq-fixture-tests branch February 11, 2026 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants