-
Notifications
You must be signed in to change notification settings - Fork 232
regression: console.error supression no longer works in 0.5 #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll take a look, but the big difference between the versions was changing from |
Hmm, I wonder what the expected workaround is for react-test-renderer....one would think it shouldn't even trigger this since it's definitely in testing mode. |
I had a look at the source code for Putting console logs into their error handler where it checks for a prevented default (which is added as an event listener to This tells be that the way errors are handled in the test renderer doesn't trigger window events, which sort of makes sense as the point is it doesn't require a DOM to render. I'm still investigating, but I see 3 options ahead:
|
@ntucker, I have raised the above issue with the React team as I cannot find any way to make it work. Can you confirm whether or not this was working for you in If the response from the React team comes back as "you can't" then I think I'll go for option 3 from my last reply. I've also been wondering if it's possible to have |
Hmm, it seems that code that is actually erroring out in the test is not printing the full stack trace due to some combination of the error boundary and error handling in the lib. This makes it difficult to debug. I think I'd go with #3 somehow, to allow errors to propagate. |
Haha @alexkrolick, I just spent way t0o long thinking about how issue #3 related to this situation 😆 @ntucker I've removed the |
react-hooks-testing-library
version: 0.5.0react-testing-library
version: 6.1.2react
version: 16.8.6node
version: 11.10npm
(oryarn
) version: 1.15.2Relevant code or config:
facebook/react#11098 (comment)
What you did:
What happened:
console.error node_modules/react-test-renderer/cjs/react-test-renderer.development.js:9215
The above error occurred in the component:
in TestHook
in Suspense
in ErrorBoundary
in Suspense (created by wrapper)
in ExternalCacheProvider
in Unknown (created by wrapper)
in wrapper
Reproduction:
Problem description:
This used to suppress the console errors from things thrown in render being caught by errorboundaries. It doesn't work anymore
Suggested solution:
The text was updated successfully, but these errors were encountered: