Skip to content

[Feature]: Explicitly mention that test is failing because done() is not being called #13844

Closed

Description

🚀 Feature Proposal

Currently, when using the done callback the test will fail with a timeout if done is never called. I believe that this test failure is not explicit enough. We should instead also mention that this timeout occurred because the done callback was never called.

Motivation

I believe it should be obvious why a test is failing. I therefore believe there is added value in letting the user know that a test is failing because the done callback was never called.

Example

Current behaviour:

test("1+1 equals 2", (done) => {
  expect(1 + 1).toBe(2);
});

>>>

Exceeded timeout of 5000 ms for a test. 
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test

Proposed behaviour:

test("1+1 equals 2", (done) => {
  expect(1 + 1).toBe(2);
});

>>>

Exceeded timeout of 5000 ms while waiting for done to be called. 
Use jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test

Pitch

See motivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions