I'm doing this in my app code:
const xhr = new XMLHttpRequest();
xhr.open("GET", "https://api.gizconnection.com/labels", true);
xhr.setRequestHeader("Authorization", "Bearer " + authService.getToken());
xhr.send(null);
and in my test I have:
it.only("test", () => {
cy.server();
cy.route("GET", "https://api.gizconnection.com/labels", [
{ text: "foo" }
]);
});
but is not matching and I'm going crazy.
In CY's log I'm seeing the request but says it doesn't match:
In Chrome's devtools I'm seeing it but the response I get is the real one from the server:
any ideas?