Closed
Description
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.2
Relevant code or config:
facebook/react#11098 (comment)
let your = (code, tell) => `the ${story}`;
What you did:
function onError(e: any) {
e.preventDefault();
}
beforeEach(() => {
window.addEventListener('error', onError);
});
afterEach(() => {
window.removeEventListener('error', onError);
});
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
React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
Reproduction:
Problem description:
This used to suppress the console errors from things thrown in render being caught by errorboundaries. It doesn't work anymore