Make test pass on purpose instead of by accident

pull/31/head
Samuel Lippert 2022-09-14 16:02:03 -05:00
parent 8e290c0b70
commit a85c140e66
No known key found for this signature in database
GPG Key ID: 3762857AF8948B2C
1 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ describe('Sentry middleware', () => {
app.use('/sentry/*', sentry(undefined, callback)) app.use('/sentry/*', sentry(undefined, callback))
app.get('/sentry/foo', (c) => c.text('foo')) app.get('/sentry/foo', (c) => c.text('foo'))
app.get('/sentry/bar', (c) => getSentry(c).log('bar') && c.text('bar')) app.get('/sentry/bar', (c) => getSentry(c).log('bar') || c.text('bar'))
app.get('/sentry/error', () => { app.get('/sentry/error', () => {
throw new Error('a catastrophic error') throw new Error('a catastrophic error')
}) })
@ -38,7 +38,7 @@ describe('Sentry middleware', () => {
const req = new Request('http://localhost/sentry/bar') const req = new Request('http://localhost/sentry/bar')
const res = await app.fetch(req, {}, new Context()) const res = await app.fetch(req, {}, new Context())
expect(res).not.toBeNull() expect(res).not.toBeNull()
expect(res.status).toBe(500) expect(res.status).toBe(200)
expect(log).toHaveBeenCalled() expect(log).toHaveBeenCalled()
}) })