0
0
mirror of https://github.com/honojs/hono.git synced 2024-12-01 10:51:01 +00:00
hono/test/middleware.test.ts
Minghe 52b56e6ddb
feat(miniflare): repalce service-worker-mock with miniflare (#41)
* feat(miniflare): repalce service-worker-mock with miniflare

* feat(ci): add build step
2022-01-12 02:14:53 +09:00

17 lines
466 B
TypeScript

import { Hono, Middleware } from '../src/hono'
describe('Builtin Middleware', () => {
const app = new Hono()
app.use('*', Middleware.poweredBy())
app.get('/', () => new Response('root'))
it('Builtin Powered By Middleware', async () => {
const req = new Request('http://localhost/')
const res = await app.dispatch(req)
expect(res).not.toBeNull()
expect(res.status).toBe(200)
expect(res.headers.get('X-Powered-By')).toBe('Hono')
})
})