-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature]: Explicitly mention that test is failing because done()
is not being called
#13844
Comments
This is great! Thanks @lpizzinidev! |
Hi guys, I am getting an error that is very common to happen in the CI pipeline with the message:
It took a while to understand what "testfalse" meant. The test was negative (passed), but it timed out!? Googling gives nothing. 😅 I searched in the jest code and found that: // node_modules/jest-circus/build/utils.js
// line 208
const _makeTimeoutMessage = (timeout, isHook, takesDoneCallback) =>
`Exceeded timeout of ${(0, _jestUtil.formatTime)(timeout)} for a ${
isHook ? 'hook' : 'test'
}${
takesDoneCallback && ' while waiting for `done()` to be called'
}.\nUse jest.setTimeout(newTimeout) to increase the timeout value, if this is a long-running test.`; So, the change from this issue creates the word "testfalse" when the It was very confusing for me. Maybe it could be good to change it to avoid creating this testfalse. |
yep! wanna send a PR? Just changing |
@SimenB, sure! I can do it. I'll send it. Thanks for your feedback. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
🚀 Feature Proposal
Currently, when using the
done
callback the test will fail with a timeout ifdone
is never called. I believe that this test failure is not explicit enough. We should instead also mention that this timeout occurred because thedone
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:
Proposed behaviour:
Pitch
See motivation.
The text was updated successfully, but these errors were encountered: