Skip to content

test(vps): strengthen music-artists fallback parity check#147

Open
guidefari wants to merge 1 commit into
migration/2c-better-auth-routefrom
migration/3a-health-httpapi-group
Open

test(vps): strengthen music-artists fallback parity check#147
guidefari wants to merge 1 commit into
migration/2c-better-auth-routefrom
migration/3a-health-httpapi-group

Conversation

@guidefari

Copy link
Copy Markdown
Owner

Why this exists: you flagged that the step 2a test for `/api/music/artists` only checked `Array.isArray(body)` -- that would pass even if the fallback silently returned an empty array or a shape Hono never actually produces. It wasn't testing what the file claims to test (parity between the new handler and Hono).

Stacked on #146 (merge #142 -> ... -> #146 first).

What changed

Replaced the shape sniff with a real parity check: request the same path through both `webHandler.handler()` and the known-good `app.request()`, assert identical status and body.

Verification

  • `bun --filter='@gbfm/vps' typecheck` -- clean
  • `routes.blackbox.test.ts`: 6/6 passing
  • lint/format clean

Next

Step 3a: port health handlers to `HttpApiBuilder.group`, the first real `HttpApi` group taking over live traffic from the fallback.

The step 2a test only checked Array.isArray(body) for
/api/music/artists via the new handler -- it would pass even if the
fallback silently returned an empty array or a different shape than
Hono's real response. Replaced with a real parity check: request the
same path through both webHandler.handler() and the known-good
app.request(), assert identical status and body. This is what the
test file's stated purpose (behavioral parity with the Hono app) actually
requires.
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.

1 participant