3 ms·
Cypress is good if you need to emulate a user navigating through screens on a site. React Testing Library is good if you want to unit test individual component
by latchkey 4y ago
Cypress is good if you need to emulate a user navigating through screens on a site.
React Testing Library is good if you want to unit test individual components.
They both have their uses.
- jkettmann 4y agoFyi with Cypress v10 and the new component testing feature you can do a lot of things that you'd usually to with RTL
- whynotminot 4y agoIt's classic journey testing vs unit testing, and you should definitely do both.
- lmiller1990 4y agoI made some content showing how the new Cypress Component Testing can also handle things you might use RTL for [0]. You can evening use the TL finders (but I don’t in this series). [0] https://youtube.com/playlist?list=PLC2LZCNWKL9bLQrMQKfTnpihgW0VFSJ_n https://youtube.com/playlist?list=PLC2LZCNWKL9bLQrMQKfTnpihg...
- philipwhiuk 4y agoDespite calling itself a unit test framework, RTL is actually component testing because it doesn't believe in shallow rendering. It's a massive pain in the ass.