DEV Community

Discussion on: what things should be covered with unit test for a react application?

Collapse
 
v0idzz profile image
Piotr Romanowski

When writing unit tests for components I usually ask myself "How would a typical user interact with this component?". This helps me come up with a couple of test cases quickly. Remember to not overdo unit tests, though. They are not a perfect solution and there's a big chance you'll be writing useless tests that will only verify if your mocks are working correctly.