How often does it happen that while you write the test for your React components you want your test base to work in the long run, so refactors of your components couldn’t break your test? We have a solution! Please meet React Testing Library with complete React DOM testing utilities.
The React Testing Library is the solution for your React components’ testing. Its main guiding principle sounds like “The more your tests resemble the way your software is used, the more confidence they can give you”. It’s hard to say better!
- If it’s about rendering components, it has to deal with DOM nodes rather than component instances.
- It can be used for testing individual React components, as well as full, React applications.
- It works for simple and flexible utility implementations and APIs.
This library is very convenient as it contains
peerDependencies listings for
react-dom. More examples and guidelines can be found here.
We also encourage you to find more React.js and JS libraries in our latest monthly digest.