Usage with react-test-renderer
See original GitHub issueI’m trying to unit test components that render RV components with the react-test-renderer
, and running into this error: https://github.com/facebook/react/issues/7371.
It seems like an issue with the usage of findDOMNode
. What is the recommended way to unit test RV components?
Issue Analytics
- State:
- Created 7 years ago
- Comments:19 (3 by maintainers)
Top Results From Across the Web
Test Renderer - React
This package provides a React renderer that can be used to render React components to pure JavaScript objects, without depending on the DOM...
Read more >TDD with React Test Renderer - LogRocket Blog
Although React Test Renderer is usually associated with snapshot testing, it can still be used to make specific assertions against your ...
Read more >Testing React Native components in Node with react ... - Medium
The react-test-renderer package makes it convenient to test components outside of their native environment (e.g. on an iOS/Android device for React Native ...
Read more >Testing React Components with react-test-renderer, and the ...
react -test-renderer is a library for rendering React components to pure JavaScript objects, but it can do a lot more than creating objects....
Read more >react-test-renderer - npm
React package for snapshot testing.. Latest version: 18.2.0, last published: 6 months ago. Start using react-test-renderer in your project ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Noting the above caveats about mocking the DOM, I adapted the AutoSizer’s mock, though it’s a little white-boxy.
I’ve noticed some issues that are pretty challenging to reproduce by defaulting the value of
AutoSizer
to the grid (column sizes aren’t recalculated though the width has changed). That’s the only real reason to mock rather than to default. If I can repro, I’ll make a bug.Even easier solution: