What should I not test in React?
Implementation details like internal state shape and instance methods, trivial components that just render a prop, and third-party libraries. Testing these wastes time and makes the suite brittle.
Verify This Answer
Cross-check this information using these trusted sources:
More FAQs in What to Test and What Not to Test in a React App
Critical user flows like login and checkout, component behavior for given props, edge cases like empty and error states, and pure utility functions. These are where tests give the most confidence and catch real regressions.
No. Trivial components that just render a prop do not need tests; the cost exceeds the value. Focus tests on components with logic, interactions, and edge cases where bugs hide.
No. Testing that a library works correctly is the library's responsibility, not yours. Test that you use it correctly, not its internals. Otherwise you are testing someone else's code.
Still have questions?
Browse all our FAQs or reach out to our support team
