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
in setupFilesAfterEnv I have added a timing object to window.performance because I have a logic that relies on those values
When I use jest.useFakeTimers("modern") performance object is overriden and timing object does not exist on it anymore
I could do the initialization logic first and then activate jest.useFakeTimers("modern") but my init logic is a bit complex and it saves references to setTimeout and some other stuff which would result in original setTimeout called when I defer something in my logic and not the faked ones.
To Reproduce
Steps to reproduce the behavior:
Assign some value to performance.timing.
Call jest.useFakeTimers("modern").
Do some logic with performance.timing
Expected behavior
I would expect to still see the timing object as that is what I prepared in my setupFilesAfterEnv file.
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.
馃悰 Bug Report
in setupFilesAfterEnv I have added a timing object to window.performance because I have a logic that relies on those values
When I use jest.useFakeTimers("modern") performance object is overriden and timing object does not exist on it anymore
I could do the initialization logic first and then activate jest.useFakeTimers("modern") but my init logic is a bit complex and it saves references to setTimeout and some other stuff which would result in original setTimeout called when I defer something in my logic and not the faked ones.
To Reproduce
Steps to reproduce the behavior:
Assign some value to performance.timing.
Call jest.useFakeTimers("modern").
Do some logic with performance.timing
Expected behavior
I would expect to still see the timing object as that is what I prepared in my setupFilesAfterEnv file.
envinfo
System:
OS: Windows 10 10.0.19042
CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
Binaries:
Node: 14.15.1 - C:\Program Files\nodejs\node.EXE
npm: 6.14.8 - C:\Program Files\nodejs\npm.CMD
npmPackages:
jest: 26.6.3 => 26.6.3
The text was updated successfully, but these errors were encountered: