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
A recent change to `runWithRealTimers` added a check for the `clock` attribute on `setTimeout` so that we can determine whether timers were faked with Jest's modern fake timers (which are based on `@sinonjs/fake-timers`).
Unfortunately, this attribute can be present when users are not using Jest's fake timers and are using sinonjs. Also, when `useFakeTimers` are invoked without parameters in Jest 26, the legacy timers are used by default.
This PR addresses two issues:
1. Don't use realTimers if the timers were not faked by Jest.
2. If we're using realTimers, make sure we're explicit when calling `useFakeTimers` so that the fakes are restored to their original state.
Closes#612
0 commit comments