We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@testing-library/dom
https://github.com/ph-fritsche/dom-testing-library/blob/24ebf282d10782b3d0a22b939a1b2950d4b5bd1b/src/__tests__/helpers.js#L86-L118
Tried to fix #884
The test leaks setTimeout only if jest.useFakeTimers('modern') has been used in some other test before.
setTimeout
jest.useFakeTimers('modern')
See relevant code above and parent commits.
Stopping the leak is not sufficient as the side-effect is in the tested unit.
The assumption that jest.getRealSystemTime() could be used to determine if a modern jest fake timer is active is wrong.
jest.getRealSystemTime()
dom-testing-library/src/helpers.js
Lines 43 to 45 in 5bc9364
Determine if a jest fake timer is active by calling jest.useRealTimers() and observing the change of global timer functions.
jest.useRealTimers()
The text was updated successfully, but these errors were encountered:
fix: remove side-effect from runWithRealTimers testing-library#884 te…
b3d0bf7
…sting-library#886
5a88d32
c787491
No branches or pull requests
@testing-library/dom
version: master = v7.29.4Relevant code or config:
https://github.com/ph-fritsche/dom-testing-library/blob/24ebf282d10782b3d0a22b939a1b2950d4b5bd1b/src/__tests__/helpers.js#L86-L118
What you did:
Tried to fix #884
What happened:
The test leaks
setTimeout
only ifjest.useFakeTimers('modern')
has been used in some other test before.Reproduction:
See relevant code above and parent commits.
Problem description:
Stopping the leak is not sufficient as the side-effect is in the tested unit.
The assumption that
jest.getRealSystemTime()
could be used to determine if a modern jest fake timer is active is wrong.dom-testing-library/src/helpers.js
Lines 43 to 45 in 5bc9364
Suggested solution:
Determine if a jest fake timer is active by calling
jest.useRealTimers()
and observing the change of global timer functions.The text was updated successfully, but these errors were encountered: