Comments (2)
Hi @shrynx! The reason is that it overcomplicates the library (both in implementation and use) and goes against the guiding principles. I would therefore recommend adding a try/catch
in your test code around the render
call as this will make things more explicit.
Based on your project I think you came up with an alternative. I'm glad. Good luck! And thanks for understanding :)
from react-testing-library.
@kentcdodds i added a PR implementing the mentioned fix
#19
from react-testing-library.
Related Issues (20)
- ByRole have inconsistent results (getting h2 instead of button)
- ReactElement not assignable HOT 3
- Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>' HOT 9
- queries returned by render are not scoped HOT 4
- Render function's typescript type excludes valid react component types
- Types are breaking HOT 12
- findBy* query fails but waitFor passes HOT 2
- Intial props not working when rendering a hook (or I've done something wrong.) HOT 5
- Snackbar not auto closing HOT 2
- Test results and "screen.debug" do not match
- Unexpected element not found when adding accessibilityElementsHidden or importantForAccessibility HOT 2
- SyntaxError: Cannot use import statement outside a module when using render or .tsx files HOT 2
- use rerender props in wrapper HOT 1
- Linting fails as "react-test-renderer" functions are interpreted as functions from "testing-library/react" HOT 2
- Calling render on a component that throws, results in 4 renders HOT 1
- React Testing library `unmount` is not working HOT 1
- Spurious `not wrapped in act` warnings from user-event, react, dom mismatch HOT 4
- Support for `onCaughtError` and `onUncaughtError` on root HOT 1
- Module parse failed: Unexpected token for the act-compat.js HOT 1
- asyncWrapper is not executed with act support HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-testing-library.