question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Config routes with no response fail to be recognised as a route

See original GitHub issue

Current behavior:

If we try to create the following route:

cy.route({
  method: 'GET',
  url: '**/some-route',
  status: 400,
}).as('someRoute');

This is failed to be picked up by Cypress as a valid route:

cy.wait('@someRoute'); // The route is not recognised, so this assertion will fail

The current workaround for this is to provide an empty response object, which is technically not correct behaviour, as this particular route does not return any response (not even an empty JSON payload):

cy.route({
  method: 'GET',
  url: '**/some-route',
  status: 400,
 response: {}
}).as('someRoute');

Desired behavior:

Routes without responses should be able to be configured / considered as valid routes by Cypress:

cy.route({
  method: 'GET',
  url: '**/some-route',
  status: 400,
}).as('someRoute');

Steps to reproduce: (app code and test code)

Same as per the current behaviour

Versions

Cypress: Latest, 3.2.0 Operating System: macOS High Sierra 10.13.6 Browser: Chrome and/or Electron 59

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jeep87ccommented, Apr 15, 2019

I’m having the exact same issue. It also fails doing something like cy.route('/some/route')

0reactions
emilyrohrboughcommented, Nov 17, 2022

In the upcoming v12.0.0 release, the deprecated cy.route() and cy.server() commands and the deprecated Cypress.Server.defaults API will be removed. This has been replaced with cy.intercept(). Close as this is no longer application.

Please try recreating this issue with the latest Cypress version and cy.intercept(). If you are still having problems please open a new Github issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why doesn't Symfony 5.1 recognize routes configured on a ...
Routes configured inside a file routes.php result in the error "No route found for "GET /something" (404 Not Found)". When running debug:router ......
Read more >
Route configuration | OpenShift Container Platform 4.10
Path -based routing is not available when using passthrough TLS, as the router does not terminate TLS in that case and cannot read...
Read more >
I see "No route" or "Routing server error" - Waze Help
I see "No route" or "Routing server error". If you see one of the above routing errors, it could be because the search...
Read more >
Rails Routing from the Outside In - Ruby on Rails Guides
If there is no matching route, then Rails returns HTTP status 404 to the caller. 2.2 RESTful Routes. RESTful routes take advantage of...
Read more >
Routing concepts - Fortinet Documentation Library
Sometimes upon routing table changes, it is not desirable for traffic to be routed to a different gateway. For example, you may have...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found