-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow LogBoxLog-test to work with native promises
Summary: This test currently uses `jest.runAllTicks()` to execute cached, immediately-resolving promises, under Jest "legacy" timers (the RN default) - this works only because [we polyfill Promise](https://github.com/facebook/react-native/blob/main/jest/setup.js#L24) using a userland JavaScript implementation that internally uses mocked-out timer functions. Here we change to a more universal approach by adding a new microtask/promise to the end of the queue and awaiting it. This allows us to remove our Promise polyfill from Jest setup (to follow). Changelog: [Internal][Fixed] - Prepare `LogBoxLog-test.js` for native promises Reviewed By: huntie Differential Revision: D39418413 fbshipit-source-id: 1384ef385b1e10261754513369af8997d296ffea
- Loading branch information
1 parent
8e0168f
commit feead8f
Showing
1 changed file
with
17 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters