https://cypress.io logo
Ok so I was doing very similar. In this scenario r...
# help
s
Ok so I was doing very similar. In this scenario response is of type
Interceptor
so it might look like:
Copy code
ts
cy.wait("@getSomething").then(interceptor => {
  expect(interceptor.response?.statusCode).to.be.eq(200);
  expect(interceptor.response?.body.data.package.insert.errors).to.have.length(0);
}
I noticed however that using the
its().should()
alternative meant I wasn't dealing with a potentially undefined value
interceptor.response
so I wasn't sure if I was handling it correctly.