Skip to content
Myr

Pass the tests

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

authored by Yusuke Wada · committed by Yusuke Wada · parent bdfb9d7 · Browse files · 2 files+23 added−17 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+23 added−17 removed

  • tests:+8 added−7 removed
  • other:+15 added−10 removed

2 files+23 added−17 removed

modified:src/hono.js+15 added-10 removed
modified:src/hono.test.js+8 added-7 removed
27 unmodified lines
28})2930describe('params and query', () => {31 const app = Hono()32 app.get('/entry/:id', (req) => {33 const id = req.params('id')32 app.get('/entry/:id', async (req) => {33 const id = await req.params('id')34 return new fetch.Response(`id is ${id}`, {35 status: 200,36 })37 })38 app.get('/search', (req) => {39 const name = req.query('name')40 return new fetch.Response(`name is ${name}`, {38 app.get('/search', async (req) => {39 const name = await req.query('name')40 let res = new fetch.Response(`name is ${name}`, {41 status: 200,42 })43 return res44 })45 it('params of /entry/:id is found', async () => {46 let req = new fetch.Request('https://example.com/entry/123')47 let res = await app.dispatch(req)
7 unmodified lines
55 expect(await res.text()).toBe('name is sam')56 })57})5858describe('Middleware', () => {59 let app = Hono()59describe.skip('Middleware', () => {60 const app = Hono()6162 const logger = (req, _, next) => {63 console.log(`${req.method} : ${req.url}`)64 next()
20 unmodified lines