You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Callback style tests that fail with an uncaughtException seem to wait until the timeout occurs before proceeding.
I assume it's waiting for a done that's never called. unhandledRejection does not wait.
This only happens when using jest-circus/runner (v26.4.2).
Consider the code below:
test('uncaught exception fails quickly',(done)=>{setTimeout(()=>{expect(true).toBe(false)// will trigger uncaught exception handlerdone()})})test('unhandled rejection fails quickly',async()=>{constwait=(ms)=>newPromise((resolve)=>setTimeout(resolve,ms))// intentionally unchained asyncwait().then(()=>{expect(true).toBe(false)// will trigger unhandled rejection handler})awaitwait(100)// ensure still inside this test when unhandled rejection above happens})
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.
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
💥 Regression Report
Callback style tests that fail with an
uncaughtException
seem to wait until the timeout occurs before proceeding.I assume it's waiting for a
done
that's never called.unhandledRejection
does not wait.This only happens when using
jest-circus/runner
(v26.4.2).Consider the code below:
Default jasmine2 runner: 7ms + 2ms
jest-circus/runner: 5004ms + 105 ms
Expected Behaviour
Unhandled rejections/exceptions should behave the same where possible. Ideally neither waits around for the timeout.
Run
npx envinfo --preset jest
The text was updated successfully, but these errors were encountered: