Description
“All code is guilty, until proven innocent.” — Anonymous
Summary
- Let’s be honest, writing tests for your React components is probably not your favorite thing to do.
- Another big reason I prefer using React Testing Library is because of the libraries philosophy which essentially states that your tests should resemble the way your users will interact with your app.
- When one of your users is using your app they are not aware of the fact that they are interacting with state and props.
- So, rather than testing whether or not the correct props or state were changed in your component, React Testing Library is designed in such a way that you have to test what your users are seeing and doing.