Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deps: Use Jest 26, the latest, with a
resolutions
hack.
We've had Jest 26 as a direct dependency for a while (since fb23341), so it's surprising that the `jest` command hasn't been using it. As Greg points out [0], that turns out to be because `jest-expo` apparently provides its own wrapper for the `jest` command, using the Jest that `jest-expo` depends on. That's Jest 25, even in `jest-expo`'s latest. And Yarn ends up giving us that wrapper. We know we'll soon want to use Jest 26 for a few things: - The "modern" implementation of fake timers [1], for zulip#4165. - The `selectProjects` CLI argument [2], for testing Android codepaths in a nice way (later in this series). But we've *also* realized that we don't really want to jettison `jest-expo` again, as we've done a few times as we learn new things: 62621ef jest: Add `jest-expo` preset, to be used in the next commit. 347aa96 jest: Back out `jest-expo` preset, for now. c4fca9d jest: Add and use `jest-expo` preset, again. In particular, we really want to use the `jest-expo/ios` and `jest-expo/android` presets (which we'll do later in this series). This is a hack because the `resolutions.jest-expo/jest` range `^26.4.1` is incompatible with the original range that `jest-expo` declares; that's `^25.2.0`. We believe this should get us a warning from Yarn; according to a doc [3], "You will receive a warning if your resolution version or range is not compatible with the original version range." I haven't seen a warning like that, even after removing node_modules and running `yarn`; this seems like a Yarn bug. I've opened expo/expo#12735 to bump Jest in the `jest-expo` project; this hack should hopefully be fine while we wait for that. [0] zulip#4700 (comment) [1] https://github.com/facebook/jest/blob/master/CHANGELOG.md#2600 [2] https://github.com/facebook/jest/blob/master/CHANGELOG.md#2610 [3] https://classic.yarnpkg.com/en/docs/selective-version-resolutions/#toc-tips-tricks
- Loading branch information