mirror of
https://github.com/honojs/hono.git
synced 2024-11-25 13:19:30 +01:00
ff5a83b38b
* perf: Speed up to calculate content-length
18 lines
501 B
TypeScript
18 lines
501 B
TypeScript
import { Hono } from '../src/hono'
|
|
import { Middleware } from '../src/middleware'
|
|
|
|
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')
|
|
})
|
|
})
|