2022-08-10 00:32:06 +08:00
|
|
|
import { sentry } from '../deno_dist/mod.ts'
|
2022-08-04 07:54:30 +08:00
|
|
|
import { assertEquals, Hono } from './deps.ts'
|
|
|
|
|
|
|
|
// Test just only minimal patterns.
|
|
|
|
// Because others are tested well in Cloudflare Workers environment already.
|
|
|
|
|
2022-08-10 00:32:06 +08:00
|
|
|
Deno.test('Sentry Middleware', async () => {
|
2022-08-04 07:54:30 +08:00
|
|
|
const app = new Hono()
|
2022-08-10 00:32:06 +08:00
|
|
|
app.use('/sentry/*', sentry())
|
|
|
|
app.get('/sentry/foo', (c) => c.text('foo'))
|
2022-08-04 07:54:30 +08:00
|
|
|
|
2022-08-10 00:32:06 +08:00
|
|
|
const res = await app.request('http://localhost/sentry/foo')
|
2022-08-04 07:54:30 +08:00
|
|
|
assertEquals(res.status, 200)
|
|
|
|
})
|