Skip to content

test: cover the HTTP API and agent search#45

Merged
brunobuddy merged 2 commits into
mainfrom
feat/ui-api-testing-ci
Jun 2, 2026
Merged

test: cover the HTTP API and agent search#45
brunobuddy merged 2 commits into
mainfrom
feat/ui-api-testing-ci

Conversation

@brunobuddy
Copy link
Copy Markdown
Member

💭 Why

The data layer was well tested, but the HTTP API and the in-browser agent search had no coverage. A regression in either would have shipped silently.

✨ What changed

  • Extract the Express app from dev.ts into app.ts with an injectable model loader, so routes are testable without the watcher or bundler.
  • Split WebMCP search into a pure searchCatalog (no DOM) for unit testing; UI mirroring stays in searchModels.
  • Add 15 API tests (every endpoint, 404 paths, suppressed x-powered-by) and 11 agent-search tests (query, provider, capability, auth, limits, shape).

📝 Notes

Both files run in CI through the existing npm test step (vitest auto-discovers tests/**). No behavior change to the running app.

Extract the Express app from dev.ts into app.ts with an injectable model
loader so every route can be exercised over real HTTP without booting the
file watcher or the bundler. Split the WebMCP search into a pure
searchCatalog so the agent-facing search contract is unit-testable without
a DOM; the visible-filter mirroring stays in searchModels.

Add tests/server.test.ts (15 tests) covering every endpoint, 404 paths,
and the suppressed x-powered-by header, plus tests/webmcp.test.ts (11
tests) covering query, provider, capability, and auth filtering, limits,
and result shape. Both run in CI via the existing npm test step.
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
modelparams.dev Ready Ready Preview Jun 2, 2026 7:36pm

Request Review

@github-actions github-actions Bot added the site Website code or tooling label Jun 2, 2026
@brunobuddy brunobuddy merged commit 5e79368 into main Jun 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

site Website code or tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant