Skip to content
Myr

Chaind route without route method (#29)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fixed #25

authored by Yusuke Wada · committed by GitHub · parent 7c87ac6 · Browse files · 2 files+22 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+22 added−0 removed

  • tests:+21 added−0 removed
  • other:+1 added−0 removed

2 files+22 added−0 removed

modified:src/hono.ts+1 added
modified:test/hono.test.ts+21 added
63 unmodified lines
64 req = new Request('/route', { method: 'DELETE' })65 res = await app.dispatch(req)66 expect(res.status).toBe(404)67 })6869 it('Chained route without route method', async () => {70 app71 .get('/without-route', () => new Response('get /without-route'))72 .post(() => new Response('post /without-route'))73 .put(() => new Response('put /without-route'))7475 let req = new Request('/without-route', { method: 'GET' })76 let res = await app.dispatch(req)77 expect(res.status).toBe(200)78 expect(await res.text()).toBe('get /without-route')7980 req = new Request('/without-route', { method: 'POST' })81 res = await app.dispatch(req)82 expect(res.status).toBe(200)83 expect(await res.text()).toBe('post /without-route')8485 req = new Request('/without-route', { method: 'DELETE' })86 res = await app.dispatch(req)87 expect(res.status).toBe(404)88 })89})9091describe('params and query', () => {92 const app = new Hono()
110 unmodified lines