-
-
Save oieduardorabelo/0614622f8c3a427ec345ca7296341f43 to your computer and use it in GitHub Desktop.
Testando com Jest: Dica #9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jest": { | |
"setupFiles": [ | |
"<rootDir>/test-setup.js" | |
] | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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