Skip to content

refactor(provider/amazon-bedrock): finish fixture migration for doGenerate tests#12503

Merged
gr2m merged 4 commits intomainfrom
josh/bedrock-fixture-migration
Feb 12, 2026
Merged

refactor(provider/amazon-bedrock): finish fixture migration for doGenerate tests#12503
gr2m merged 4 commits intomainfrom
josh/bedrock-fixture-migration

Conversation

@dancer
Copy link
Collaborator

@dancer dancer commented Feb 12, 2026

background

amazon-bedrock was partially migrated to the fixture-based test pattern - doStream and some doGenerate tests already used prepareJsonFixtureResponse / prepareChunksFixtureResponse, but the doGenerate section still had an inline prepareJsonResponse helper used by ~29 tests

summary

  • remove 2 duplicate tests (should extract text response and should extract usage) that were identical to existing fixture-based tests in the describe('text') block
  • replace prepareJsonResponse({}) calls with prepareJsonFixtureResponse('bedrock-text') for tests that only check request body/headers
  • replace prepareJsonResponse({...specific fields...}) calls with direct server.urls[generateUrl].response assignment for tests that need specific response content
  • delete the prepareJsonResponse helper function and unused BedrockReasoningContentBlock / BedrockRedactedReasoningContentBlock imports

no new fixtures were needed - all existing fixtures were already recorded from real API calls

verification

  • grep -c prepareJsonResponse returns 0
  • test count: 103 → 101 (2 duplicates removed)
  • 290/290 tests pass

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)

remove 'should extract text response' and 'should extract usage' tests
from the inline section since identical fixture-based versions already
exist in the describe('text') block
…th fixture

switch tests that only check request body/headers to use
prepareJsonFixtureResponse('bedrock-text') instead of inline helper
…irect server.urls

convert remaining tests that need specific response content to use
direct server.urls[generateUrl].response assignment instead of the
inline prepareJsonResponse helper
delete the inline prepareJsonResponse function and unused
BedrockReasoningContentBlock/BedrockRedactedReasoningContentBlock imports
@vercel-ai-sdk vercel-ai-sdk bot added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider labels Feb 12, 2026
@gr2m gr2m merged commit 244bee8 into main Feb 12, 2026
25 checks passed
@gr2m gr2m deleted the josh/bedrock-fixture-migration branch February 12, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/amazon-bedrock Issues related to the @ai-sdk/amazon-bedrock provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants