Commit 81db86a
refactor(provider/anthropic): finish fixture migration for doGenerate tests (#12511)
## background
anthropic tests were partially migrated to the fixture-based pattern -
doStream and some doGenerate tests already used
`prepareJsonFixtureResponse` / `prepareChunksFixtureResponse`, but 3
`prepareJsonResponse` helper definitions (55 total calls) still remained
## summary
- record `anthropic-text.json` and `anthropic-text.chunks.txt` fixtures
from real API (`claude-sonnet-4-5-20250929`)
- replace 23 `prepareJsonResponse({})` calls (tests that only check
request body/headers) with
`prepareJsonFixtureResponse('anthropic-text')`
- inline `server.urls` assignments for 10 main doGenerate tests that
need specific response content (reasoning, usage, citations, tool calls,
etc.)
- inline `server.urls` assignments for 8 web search tests and delete the
scoped helper
- inline `server.urls` assignments for 4 code execution tests and delete
the scoped helper
- remove the main `prepareJsonResponse` function definition and unused
`Citation`/`JSONObject` imports1 parent 6875474 commit 81db86a
3 files changed
Lines changed: 462 additions & 401 deletions
File tree
- packages/anthropic/src
- __fixtures__
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
0 commit comments