-
-
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
Fix asynchronous test will fail due to timeout issue. #4669
Conversation
I don't understand how this i happening but I can confirm both the issue, and the fact that this diff fixes it. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs an integration test
Cool, thanks for the explanation! Adding an integration test for this should be pretty simple, just assert on |
* Send error event to Node.js process.
Thanks! I updated the test you wrote to actually run in jsdom (it passed without your changes as well, as it ran in node environment). |
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
* @jest-environment jsdom |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now there is no way to assert what testEnvironment
a test is run in. But I doubt someone will change this anyways, so shouldn't be a problem
This is a nice fix, thank you for sending a PR. |
@H1Gdev would you mind sending a PR adding a line to the changelog about this? 🙂 |
@SimenB |
* Add jestjs#4669 to CHANGELOG.
+ Better error handling: got stuck for a bit on #1973 because jest was giving me an "Timeout - Async callback was not invoked within timeout" error, when the real issue was much simpler than that + See jestjs/jest#4669 for details.
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Execute following asynchronous test.
Expect:
Actual:
Test plan
Above test result as expected.