2022-08-04 07:54:30 +08:00
|
|
|
import { Hono } from 'hono'
|
2022-08-04 07:33:14 +08:00
|
|
|
import { sentry } from '../src'
|
2022-08-04 07:54:30 +08:00
|
|
|
|
2022-08-04 07:33:14 +08:00
|
|
|
describe('Sentry middleware', () => {
|
2022-08-04 07:54:30 +08:00
|
|
|
const app = new Hono()
|
|
|
|
|
2022-08-04 07:33:14 +08:00
|
|
|
app.use('/hello/*', sentry())
|
2022-08-04 07:54:30 +08:00
|
|
|
app.get('/hello/foo', (c) => c.text('foo'))
|
|
|
|
|
2022-08-04 07:33:14 +08:00
|
|
|
it('Should initialize Toucan', async () => {
|
2022-08-04 07:54:30 +08:00
|
|
|
const res = await app.request('http://localhost/hello/foo')
|
|
|
|
expect(res).not.toBeNull()
|
|
|
|
expect(res.status).toBe(200)
|
|
|
|
})
|
|
|
|
})
|