mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
0ead7de5e8
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/48819 Currently, `VirtualizedList-test.js` has a subtle dependency on how asynchronous operations are queued. Specifically, it depends on... - `Batchinator` to use `setTimeout` for... - `InteractionManager` to use `setImmediate` for... - `InteractionManager` to resolve a promise via microtask. As a consequence, any changes to this queueing logic (e.g. eliminating the unnecessary `setImmediate` and microtask) unnecessarily breaks these unit tests. This changes the Jest unit tests to instead use `jest. advanceTimersToNextTimer(<step>)` instead of `jest.runOnlyPendingTimers()` so that the unit tests are no longer dependent on these specific queueing logic. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D68449850 fbshipit-source-id: 382b1c0a0d8fade873ccf17a9deb3622a83b8163
@react-native/virtualized-lists
Installation
yarn add @react-native/virtualized-lists
Note: We're using yarn to install deps. Feel free to change commands to use npm 3+ and npx if you like
Testing
To run the tests in this package, run the following commands from the React Native root folder:
yarnto install the dependencies. You just need to run this onceyarn jest packages/virtualized-lists.