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.

🚀 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:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
SimenBcommented, Jun 6, 2018

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 matcher

0reactions
github-actions[bot]commented, Mar 27, 2022

This 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.

Read more comments on GitHub >

github_iconTop 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 >

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