Fix asynchronous test will fail due to timeout issue.#4669
Fix asynchronous test will fail due to timeout issue.#4669cpojer merged 2 commits intojestjs:masterfrom
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! |
SimenB
left a comment
There was a problem hiding this comment.
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.
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. |
+ 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.