Open eps1lon opened 2 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 9a64089ada4eb09b07327483b442b10c1429b81b:
Sandbox | Source |
---|---|
react-testing-library-examples | Configuration |
What:
Alternate to https://github.com/testing-library/react-testing-library/pull/1333
Adds support for
onRecoverableError
andonCaughtError
(React 19 only)onUncaughtError
is not supported yet because there's no use. Therender
would throw anyway. We're likely going to change that though in React.Why:
This allows test setups that fail on console errors to silence specific, expected errors in their tests. Especially
onCaughtError
will simplify testing of error boundaries since it will disable React's default console.error + window.onError dispatch (see docs I'll add soon)How:
Forward mentioned options to React's
createRoot
call.Checklist: