diff --git a/src/index.ts b/src/index.ts index 2fb40972..424dfdf7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import type { Handler } from 'hono' import Toucan from 'toucan-js' -export const hello = (): Handler => { +export const sentry = (): Handler => { return async (c, next) => { const sentry = new Toucan({ dsn: c.env.SENTRY_DSN, diff --git a/test/index.test.ts b/test/index.test.ts index 23a79984..c25665a3 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,24 +1,15 @@ import { Hono } from 'hono' -import { hello } from '../src' +import { sentry } from '../src' -describe('Hello middleware', () => { +describe('Sentry middleware', () => { const app = new Hono() - app.use('/hello/*', hello()) + app.use('/hello/*', sentry()) app.get('/hello/foo', (c) => c.text('foo')) - app.use('/x/*', hello()) - app.get('/x/foo', (c) => c.text('foo')) - - it('Should be hello message', async () => { + it('Should initialize Toucan', async () => { const res = await app.request('http://localhost/hello/foo') expect(res).not.toBeNull() expect(res.status).toBe(200) }) - - it('Should be X', async () => { - const res = await app.request('http://localhost/x/foo') - expect(res).not.toBeNull() - expect(res.status).toBe(200) - }) })