Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions apps/vps/src/http/routes.blackbox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ describe('Effect toWebHandler fallback', () => {
})
})

it('GET /api/music/artists falls through to the Hono app', async () => {
const res = await webHandler.handler(new Request('http://localhost/api/music/artists'))
it('GET /api/music/artists returns the same response as the plain Hono app', async () => {
const [viaHandler, viaHono] = await Promise.all([
webHandler.handler(new Request('http://localhost/api/music/artists')),
app.request('/api/music/artists')
])

expect(res.status).toBe(200)
const body: unknown = await res.json()
expect(Array.isArray(body)).toBe(true)
expect(viaHandler.status).toBe(viaHono.status)
await expect(viaHandler.json()).resolves.toEqual(await viaHono.json())
})

it('unknown routes fall through to the Hono app and 404', async () => {
Expand Down