Skip to content

test(models): add unit tests for model.ts#74

Open
ANSHSINGH050404 wants to merge 1 commit into
bug0inc:mainfrom
ANSHSINGH050404:feat/models-tests
Open

test(models): add unit tests for model.ts#74
ANSHSINGH050404 wants to merge 1 commit into
bug0inc:mainfrom
ANSHSINGH050404:feat/models-tests

Conversation

@ANSHSINGH050404

Copy link
Copy Markdown

Adds 38 unit tests for `src/models.ts` covering all provider resolution paths.

Closes #73

What's tested

Group Tests Coverage
Missing API keys 10 ConfigurationError for every provider + gateway combo
Direct routing 6 Google, Anthropic, OpenAI + alias resolution + unknown provider
Vercel gateway 2 Routes through gateway(), missing key
OpenRouter gateway 3 Routes through OpenRouter, alias map
OpenCodeZen gateway 6 Prefix stripping, all OPENCODEZEN_MODEL_ALIASES
Cloudflare gateway 5 CF Google/Anthropic routing, alias resolution, unsupported provider
Gateway override 3 Override param precedence, fallbacks
Model ID parsing 3 Multi-slash, provider-only, single-slash IDs

…nc#73)

- 38 tests across 7 groups: missing API keys, direct routing, Vercel/OpenRouter/OpenCodeZen/Cloudflare gateways, gateway overrides, model ID parsing
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.

models.ts has no tests

1 participant