I don't think this fit what we needed to achieve. With this,apolloResponses is going to be returned as the response for all request whether we want apolloResponses to have multiple responses and be matched against the request payload parameters dynamically.
(apolloResponses was meant to be articlesResponses in this example 🤦♀️, I updated that.)
I don't think this fit what we needed to achieve. With this,
apolloResponses
is going to be returned as the response for all request whether we wantapolloResponses
to have multiple responses and be matched against the request payload parameters dynamically.(
apolloResponses
was meant to bearticlesResponses
in this example 🤦♀️, I updated that.)What I meant to say is can you do away with the external dependency of xhook and use the cypress api instead:
beforeEach(() => {
cy.server({ method: 'POST' })
cy.route({
method: 'POST',
url: '**/articles',
onResponse: (xhr) => {
// insert your JSON filtering code here
}
})
})
docs.cypress.io/api/commands/route...
That was the first thing I tried but that didn't work for this use case. I wish it did.