menu
Apollo

# Testing

Test all the things!

Posts
Members
Search

I’m looking for great example code of testing mutations, quiries and using…

thumbsup
1
message-simple
2

Is it possible to mock `refetch`?

Hello! I'm writing a jest test which is attempting to ensure that refetch is called after a mutation occurs. I'm using a MockedProvider, and am mocking the initial query and the mutation, however I need to ensure that refetch is called. In vain I tried something like the…

thumbsup
0
message-simple
0

How to test queries which require an authorization token?

Apollo Server Integration testing documentation shows how to test simple queries using createTestClient. If you have a query which requires an authorization token to be run, how do you pass such a token to the query so that can be tested with the above mentioned…

thumbsup
1
message-simple
2

apollo-datasource-rest + Typescript + Jest

I am setting up a new project using Apollo, TypeScript & Jest and I'm running into some difficulty testing my datasources that extent RESTDataSource. Jest will not mock the class to be extended & much of the advice I'm coming across recommends switching to composition over…

thumbsup
0
message-simple
0