https://cypress.io logo
cy.intercept is now matching cancelled requests
# i-need-help
a
Has anyone had any trouble with Cypress 12 picking up on cancelled requests with intercept? Is there an option to only match non-cancelled requests? Previously (on v10) it would not match cancelled requests, but in v12 it is failing quite a lot as we have cancelled requests.
p
cancelled requests dont have statuses right? Just add the status code in the interceptor or set the number of times you want it to be matched:
Copy code
js
    cy.intercept(
      "endpoint.example/api",
      { times: 1 },
      {
        statusCode: 200,
      }
    ).as("request");
a
Thanks, that's a good workaround! Although I think that this should be the default. It seems to have been the case before