test: repair test suite after R1-R3 refactors and add Claude Code tests #11
Reference in New Issue
Block a user
Delete Branch "chore/test-suite-repair"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The R1-R3 refactors removed the per-provider handle*Error methods,
consolidated validators into validateNumberInRange, renamed Gemini's
buildGenerationConfig to buildConfig, and split OpenWebUI's message
conversion and response formatting into openwebui-strategies.ts.
44 of 91 existing tests broke as a result.
Changes:
claude.test.ts (8 -> 13 passing)
normalizeError method.
validateNumberInRange wording.
openai.test.ts (16 -> 22 passing)
mapProviderError instead of the base mapping.
gemini.test.ts (17 -> 27 passing)
and provider version 2.0.0.
exposes response.text as a getter rather than walking
candidates[0].content.parts.
openwebui.test.ts (4 -> 19 passing)
formatChatResponse / formatOllamaResponse / makeRequest: these
moved into openwebui-strategies.ts and openwebui-http.ts during R3
and warrant their own test files.
providerErrorMessages plumbing.
claude-code.test.ts (new, 18 tests)
combination, multi-turn flattening with role labels, and rejects
empty turn lists.
Full suite: 100 pass / 0 fail across 5 files.