Start using Jest's "modern" fake-timer implementation. #29767
Description
Recent improvements have been made to Jest's implementation of fake timers, on an opt-in basis, with a plan to make them the default in the future: jestjs/jest#7776.
Some prep work has been done toward this (#29011), but I don't find an existing issue for the actual change.
Simply flipping the switch to the "modern" implementation gives several test failures, likely due to some combination of
- dependency on wrong semantics of the legacy implementation, and
- "Modern" fake-timer implementation doesn't work with PromiseJS. jestjs/jest#10221
I'm excited for facebook/react-native's own tests to be made more correct, but I particularly hope to draw attention to the fact that React Native apps can't currently use the new implementation (jestjs/jest#10221, #29303, #29754). This is a problem for apps that can't use the legacy implementation either, because of its issues (not having Date.now() faked is a big one).
React Native version:
v0.61.5. (See #29767 (comment), below, for more environment info.)
Activity
github-actions commentedon Aug 25, 2020
react-native infoin a console.chrisbobbe commentedon Sep 11, 2020
Ah, here's the missing environment info for the bot 🙂:
safaiyeh commentedon Oct 28, 2020
Hi @chrisbobbe thanks for the request & all the details.
You opened a PR here: https://github.com/facebook/react-native/pull/29754/files
Would this resolve the Jest issue, if merged in?
github-actions commentedon Jun 30, 2023
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
github-actions commentedon Jul 7, 2023
This issue was closed because it has been stalled for 7 days with no activity.