Skip to content

Instantly share code, notes, and snippets.

@oieduardorabelo
Forked from stipsan/package.json
Last active June 16, 2017 09:49
Show Gist options
  • Save oieduardorabelo/0614622f8c3a427ec345ca7296341f43 to your computer and use it in GitHub Desktop.
Save oieduardorabelo/0614622f8c3a427ec345ca7296341f43 to your computer and use it in GitHub Desktop.
Testando com Jest: Dica #9
{
"jest": {
"setupFiles": [
"<rootDir>/test-setup.js"
]
}
}
// Em Node v7, Promises com rejeições sem tratamento irão encerrar o processo
if (!process.env.LISTENING_TO_UNHANDLED_REJECTION) {
process.on('unhandledRejection', reason => {
throw reason
})
// Evitando memory leak ao adicionar vários listeners ao processo
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