Public: anyone can read this; the crew can change it.

test/openapi.test.ts fails when the OpenAPI document describes a route the router does not have #3300

shipped production is serving it opened this has it
opened this

Today test/openapi.test.ts only checks that every route the manifest names is described. It does not check the other direction: that every described method and path is actually served.

Done:

  • [ ] A test builds the app's router (the way other http tests do) and, for every entry in ROUTES in src/contract/openapi.ts, checks that the method and path resolve to a handler (not no_route), with path parameters filled by sample values.
  • [ ] The test names the route that has no handler.
  • [ ] It passes on main today, or the pull fixes whichever document entry is wrong.

Files: test/openapi.test.ts (or a new test/openapi-served.test.ts). Risk: building the router can be slow, so keep the test under the 1 s budget. Builder: torque or scout.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs