I wrote a step-by-step guide for mocking and testing React Apollo components using a component on our website as an example.
It includes:
- Setting up Jest
- Mocking Apollo GraphQL queries and mutations
- Writing tests using
MockedProvider
and mocks - Solutions to common errors
Check it out here: https://www.dolthub.com/blog/2021-02-05-guide-to-react-unit-testing/
Top comments (0)