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.

Make it clearer that `timeout` configuration affects mocked as well as non-mocked requests

See original GitHub issue

In cy.request() and also main configuration doc, make it clearer that responseTimeout applies to mocked as well as non-mocked requests.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mitarcommented, Mar 11, 2019

What is unclear about this issue? The issue is that responseTimeout controls timeouts of XHR requests, which is not really documented anywhere. So I think there is a bit of confusion that XHR requests can be both mocked or not. And even when XHR are not being mocked, responseTimeout still is in effect. In this way cy.request by-passes any mocking, but documentation only says that responseTimeout influences cy.request. So maybe this is why this confusion about mocking and non-mocking?

It is simply surprising that if I do not want to mock anything, some arbitrary additional not-documented timeout is inserted into my XHR requests. So maybe a reference to cy.request() was made by mistake. My issue was with XHR.

0reactions
mitarcommented, Mar 11, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

Cypress reports a timeout for a XHR request not made through ...
Make it clearer that timeout configuration affects mocked as well as non-mocked requests cypress-io/cypress-documentation#1046.
Read more >
Python Requests Mock doesn't catch Timeout exception
get method of the directly imported and therefore on the original requests module, which means that change is not reflected within your module....
Read more >
Mocking time and testing event loops in Go - Dmitry Frank
The // second is a mock clock which will only make forward progress when // programmatically adjusted. type Clock interface { After(d time....
Read more >
A Unit Testing Practitioner's Guide to Everyday Mockito - Toptal
In this article, we'll cover multiple mock interfaces, listening invocations, matchers, and argument captors, and see firsthand how Mockito makes your tests ...
Read more >
Understanding the Python Mock Object Library - Real Python
You can test how get_holidays() will respond to a connection timeout by setting requests.get.side_effect . For this example, you'll only see the relevant...
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