Skip to content

Commit 30d2091

Browse files
committed
don't set uncaughtException listeners in tests
1 parent 205d8c1 commit 30d2091

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,14 @@ Sentry.init({ dsn: process.env.SENTRY_DSN })
2525
module.exports = async (robot) => {
2626
robot.route('/').get('/health', (req, res) => res.send('OK'))
2727

28-
process.on('uncaughtException', (e) => {
29-
robot.log.error(e)
30-
})
31-
process.on('unhandledRejection', (e) => {
32-
robot.log.error(e)
33-
})
28+
if (process.env.NODE_ENV !== 'test') {
29+
process.on('uncaughtException', (e) => {
30+
robot.log.error(e)
31+
})
32+
process.on('unhandledRejection', (e) => {
33+
robot.log.error(e)
34+
})
35+
}
3436

3537
const queue = new Queue('issues', {
3638
removeOnSuccess: true,

0 commit comments

Comments
 (0)