Skip to content

Instantly share code, notes, and snippets.

@stipsan
Last active August 29, 2018 16:52
Show Gist options
  • Save stipsan/702f4de53b62fe589a27c2a7d74faec1 to your computer and use it in GitHub Desktop.
Save stipsan/702f4de53b62fe589a27c2a7d74faec1 to your computer and use it in GitHub Desktop.
Testing with Jest: Tip #9
{
"jest": {
"setupFiles": [
"<rootDir>/test-setup.js"
]
}
}
// In Node v7 unhandled promise rejections will terminate the process
if (!process.env.LISTENING_TO_UNHANDLED_REJECTION) {
process.on('unhandledRejection', reason => {
throw reason
})
// Avoid memory leak by adding too many listeners
process.env.LISTENING_TO_UNHANDLED_REJECTION = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment