-
-
Save Kolenov/a794a8fb95d4727ec63455076a870635 to your computer and use it in GitHub Desktop.
This file contains 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
const originalConsoleError = console.error; | |
console.error = message => { | |
if (/(Failed prop type)/.test(message)) { | |
throw new Error(message); | |
} | |
originalConsoleError(message); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The setupFiles is not exposed by default when the app is created using create-react-app. So, the tests will not run at all.
The alternative is to include the contents of throw-on-prop-type-error.js to src/setupTests.js