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
Ideally, in addition to this, it would be nice to grab the pending timers from jsdom and show a warning or an error depending on some option like detectPendingTimers or simply wait until they all complete (or timeout). https://github.com/jsdom/jsdom/blob/2f8a7302a43fff92f244d5f3426367a8eb2b8896/lib/jsdom/browser/Window.js#L494
(happy-dom exposes a waitUntilComplete() function, we could contribute to jsdom in order to expose something similar)
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.
馃殌 Feature Proposal
The following tests will not show any error when using
jsdom
environment:It would be nice if Jest could detect pending timers or wait for them to finish on environment teardown.
There are different options. The cheapest workaround is the one used in vitest but it will only flush queued macrotasks and 0s timers:
https://github.com/vitest-dev/vitest/blob/fee7d8be9d6e6f710270600ae91fa35d861b7075/packages/vitest/src/runtime/setup-node.ts#L85
Ideally, in addition to this, it would be nice to grab the pending timers from
jsdom
and show a warning or an error depending on some option likedetectPendingTimers
or simply wait until they all complete (or timeout).https://github.com/jsdom/jsdom/blob/2f8a7302a43fff92f244d5f3426367a8eb2b8896/lib/jsdom/browser/Window.js#L494
(happy-dom exposes a
waitUntilComplete()
function, we could contribute to jsdom in order to expose something similar)Credits go to @rainerhahnekamp for raising the issue.
I'll be happy to help with a PR.
Motivation
This will help Jest detect some issues that are currently silenced. This aligns with how vitest jsdom env works.
Example
No response
Pitch
This will help Jest detect some issues that are currently silenced.
The text was updated successfully, but these errors were encountered: