-
-
Save oieduardorabelo/898772a6a203e9f09c44bac07119840e to your computer and use it in GitHub Desktop.
Testando com Jest: Dica #8
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
// eslint-disable-next-line no-console | |
const error = console.error | |
// eslint-disable-next-line no-console | |
console.error = (warning, ...args) => { | |
if (/(Invalid prop|Failed prop type)/gi.test(warning)) { | |
throw new Error(warning) | |
} | |
error.apply(console, [warning, ...args]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment