February 28, 2019
Integration testing in the context of GraphQL means testing your server’s ability to call the resolvers to fetch the data.
Typically you’d already have individual unit tests for the logic within your resolvers, and you just want to test whether or not your server actually sends the data the way you expect it to.
First off, you’re going to need a GraphQL server.
You’ll then need to write a helper function that runs GraphQL queries against your server’s address.
For each test, the function will need to:
For each test on subsequent runs, the function will need to:
If you'd like more tips on how to improve your frontend, you can follow me on Twitter as I regularly post articles there.