Skip to content

Commit

Permalink
test(combine): Modified tests to cover modified cases
Browse files Browse the repository at this point in the history
  • Loading branch information
usualoma committed Feb 8, 2025
1 parent e0cf156 commit 033d48b
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/middleware/combine/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,13 @@ describe('some', () => {
}
const middleware2 = vi.fn(() => true)

app.use('/', some(middleware1, middleware2))
app.get('/', () => {
throw new Error('Error')
})
app.use(
'/',
every(some(middleware1, middleware2), () => {
throw new Error('Error')
})
)
app.get('/', (c) => c.text('OK'))
app.onError((_, c) => {
return c.text('oops')
})
Expand All @@ -115,10 +118,13 @@ describe('some', () => {
const middleware1 = () => true
const middleware2 = vi.fn(() => true)

app.use('/', some(middleware1, middleware2))
app.get('/', () => {
throw new Error('Error')
})
app.use(
'/',
every(some(middleware1, middleware2), () => {
throw new Error('Error')
})
)
app.get('/', (c) => c.text('OK'))
app.onError((_, c) => {
return c.text('oops')
})
Expand Down

0 comments on commit 033d48b

Please sign in to comment.