I am trying to write a cypress test that emulates a slow API, so after reading some documentation I came up with this:
before(function() {
cy.server({delay: 5000});
});
beforeEach(() => {
cy.route({
method: "GET",
url: "**/api/**"
});
cy.visit("http://localhost:9000");
});
That should add a 5 second delay to all requests to API, right?
The issue I am seeing is that it is not matching to any requests even through there are plenty of calls to */api/*.
The cypress GUI does however see the route... it is just not matching.
What could be the cause of this?
