Is there a way in a Cypress test to stub a GraphQL query called with Next.JS getServerSideProps
?
I have tried using cy.intercept
, but, being the request done server side, cy.intercept
doesn't seem to intercept it.
Is there a way in a Cypress test to stub a GraphQL query called with Next.JS getServerSideProps
?
I have tried using cy.intercept
, but, being the request done server side, cy.intercept
doesn't seem to intercept it.
You can use something like 'nock' which will spin up a BE server, and allow you to set up the responses to return when getServerSide executes as part of the cypress page test