You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When testing a normal component I can use the MockedProvider from @apollo/react-testing to stub about the queries. However I'm a bit lost to how I would test the getInitialProps function.
I could just mock out the ctx.apolloClient.query function to return the expected data but this won't provide much value. Is there a way to mock out the apollo client in the NextJS context similar to the way MockedProvider works?
The text was updated successfully, but these errors were encountered:
I have a page component that is using
getInitialProps
to fetch data using Apollo via thectx.apolloClient
.When testing a normal component I can use the
MockedProvider
from@apollo/react-testing
to stub about the queries. However I'm a bit lost to how I would test thegetInitialProps
function.I could just mock out the
ctx.apolloClient.query
function to return the expected data but this won't provide much value. Is there a way to mock out the apollo client in the NextJS context similar to the wayMockedProvider
works?The text was updated successfully, but these errors were encountered: