Timeout Reason
See original GitHub issue🚀 Feature Proposal
Perhaps there is already a way to do this, but it would be nice if functions could register reasons for tiemouts. For example, let’s say I have waitElementToBecomeVisible():
await waitElementToBecomeVisible("selector");
waitElementToBecomeVisible could do something like:
async function waitElementToBecomeVisible(selector)
{
jest.pushTimeoutReason(`An element matching ${selector} did not become visible in the timeout`);
// ...
jest.popTimeoutReason();
}
Motivation
More friendly test failures.
Example
See above.
Pitch
Since it interacts with the default timeout. If each method had its own timeout, then this wouldn’t be necessary, but a global timeout necessitates transferring information.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
What Does a Server Connection Timeout Mean?
Timeout errors can happen for a number of reasons. The server, the requesting device, the network hardware and even an Internet connection can...
Read more >What is a connection timeout during a http request
Connection timeout is a common error that occurs whenever the client is waiting for too long before getting a response from any server...
Read more >Timeout conditions - possible causes and fixes - IBM
Timeout conditions - possible causes and fixes ; Session, The session is idle through lack of use. If you consider losing idle sessions...
Read more >Server Connection Timeout Error Explained - Crazy Domains
The possible causes may be a server issue, outdated browser and cache, blacklisted sites, sporadic internet connection, faulty extensions, etc.
Read more >[SOLVED] How to Fix the ERR_CONNECTION_TIMED_OUT ...
There can be various causes that can turn out to be the potential reasons for the connection timed out error. Some of these...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
await expect(functionThatReturnsAPromise).toResolveWithinMs(4500)
, and we could ignore rejections?It would be awesome if it could query the timeout of the test though - if the test times out the stack trace will point to the test itself, not the specific
expect
.A
jest.waitFor(func)
that was aware of the test’s timeout would be pretty sweet, I think, even though I like the idea of a matcherThis issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.