Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sharifhh authored Jan 10, 2024
1 parent fca7c51 commit c72d287
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/http-cors/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -819,15 +819,11 @@ test('it should set Vary header if present in config', async (t) => {
})
})

test('it should throw when not a http event', async (t) => {
test('it should not throw when not a http event', async (t) => {
const handler = middy((event, context) => {})

handler.use(cors())

const event = {}
try {
await handler(event, context)
} catch (e) {
t.is(e.message, 'Unknown http event format')
}
t.notThrows(async () => await handler(event, context))
})

0 comments on commit c72d287

Please sign in to comment.