Skip to content

Commit

Permalink
Ensure the fake agent in integration tests doesn't swallow exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Dec 11, 2024
1 parent 1a95b0b commit 3f20bfd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions integration-tests/helpers/fake-agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,14 @@ function buildExpressServer (agent) {
})
})

// Ensure that any failure inside of Express isn't swallowed and returned as a 500, but instead crashes the test
app.use((err, req, res, next) => {
if (!err) next()
process.nextTick(() => {
throw err
})
})

return app
}

Expand Down

0 comments on commit 3f20bfd

Please sign in to comment.