The Do's and Don'ts of Testing Apollo in React
Adam Hannigan
Engineering Team LeadAs the Apollo ecosystem evolves we find ourselves relying extensively on the underlying functionality it provides. The recent version 3 has highlighted this with the introduction of domain driven type policies and local state management. This enables engineers to consolidate business logic, centralise state and perform advanced data manipulation. However, we now enter dangerous territory where our apps are heavily dependent on external data and the Apollo library.
Writing tests is essential for any Apollo application that aims to be scalable, robust and allows its developers to sleep soundly at night. By harnessing a range of tools you will be able confidently release, ship higher quality code and improve your team’s efficiency.
This article uses Typescript, Apollo version 3 & React Testing Library for examples.