Open sarink opened 5 years ago
How can I intercept the stubbed fetch call to inspect the request body?
It's a bit clunky, but you can do something like:
cy.get("@fetchStub").then((stub) => { const mutation = JSON.parse(stub.getCall(0).args[1].body); expect(mutation.variables).to.deep.eql(expectedVariables); });
How can I intercept the stubbed fetch call to inspect the request body?