forked from zulip/zulip-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
jest: Add and use
jest-expo
preset, again.
Done to reduce boring mocks (in particular, remove boring mocks for things from Expo) in our Jest setup. A redo of 62621ef and e40c020, reverted in 347aa96, which we can do following the recent RN upgrade to v0.62 (see 347aa96 for details). Since we're on [email protected], use 16.11.0 as the version range for react-dom, instead of 16.9.0 as we did in 62621ef. (We don't use any code in react-dom, but we unfortunately have to include it to satisfy peer dependencies; see 62621ef.) This time around, we get a peer-dependency warning suggesting we need to install expo-splash-screen: """ warning "jest-expo > @expo/config > @expo/[email protected]" has unmet peer dependency "expo-splash-screen@*". """ So, do that. It really should go under `devDependencies`, since we only need it for jest-expo. But I find that react-native-unimodules is automatically linking `expo-splash-screen`'s native code on iOS and Android, whether it's in `devDependencies` or `dependencies`. Although I didn't encounter problems building and running for release on iOS or Android with it in `devDependencies`, it seems problematic to link native code from a package we've said is for development only. So, reluctantly, say that it's not for development only, by putting it under `dependencies`. We may in fact want to use it in production one day; if we do, we'll probably need to put together a Flow libdef. [1] We can't do the usual thing to prevent it from getting linked, adding lines to `react-native.config.js`. It seems Unimodules isn't informed by that file, which is where React Native's autolinking (a separate process) takes its cues from. There may be a way to tell Unimodules to exclude it, but it seems to mean calling code in two or three places that's mostly meant for internal use; see https://forums.expo.io/t/unimodules-what-else-can-i-exclude/41079 and expo/expo#9736 (comment).
- Loading branch information
1 parent
e122cfb
commit c4fca9d
Showing
6 changed files
with
1,946 additions
and
134 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
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
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
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
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
Oops, something went wrong.