Skip to content
Discussion options

You must be logged in to vote

Sometimes writing a question is enough. 5 min after posting this I had a realisation that its way simpler than I was thinking:

 cy.intercept(
    {
      method: options.withRequest.method,
      url: urlToMatch,
    },
    (req) => {
      req.url = `http://${server.host}:${server.port}${options.withRequest.path}`;
      req.continue();
    },
  ).as(options.as);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Maxim-Filimonov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant