Reanimated 2.5.0 break Jest test
See original GitHub issueDescription
Run jest test with Reanimated 2.5.0. Test break with following error:
● Test suite failed to run
TypeError: ReanimatedModule.installTurboModule is not a function
at new NativeReanimated (node_modules/react-native-reanimated/lib/reanimated2/NativeReanimated/NativeReanimated.js:6:98)
at JSReanimated._createSuperInternal (node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/JSReanimated.js:32:311)
at new JSReanimated (node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/JSReanimated.js:8:9)
at Object.<anonymous> (node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/index.js:3:22)
at Object.<anonymous> (node_modules/react-native-reanimated/lib/reanimated2/NativeReanimated/index.js:1:1)
Expected behavior
Test pass as before
Actual behavior & steps to reproduce
- Create a new RN app with 0.67.4 and Reanimated 2.5.0 and Jest.
- Write an example test.
- run
yarn testthen example test will fall
Snack or minimal code example
As mentioned above, an example project with jest will work
Package versions
| name | version |
|---|---|
| react-native | 0.67.4 |
| react-native-reanimated | 2.5.0 |
| NodeJS | |
| Xcode | |
| Java | |
| Gradle | |
| expo |
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created a year ago
- Reactions:7
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Testing with Jest | React Native Reanimated - Software Mansion
Testing with Jest. Reanimated test mocks use web implementation of Reanimated2. Before you begin using Reanimated mocks you need some setup actions.
Read more >Npm libraries not working in React Native - Stack Overflow
Perform the Below steps: delete node_modules folder; delete package-lock.json file; install new version of dev Dependencies. npm install.
Read more >react-native-reanimated:buildcmakedebug - You.com | The search ...
You.com is an ad-free, private search engine that you control. Customize search results with 150 apps alongside web results. Access a zero-trace private ......
Read more >react-native-navigation | Yarn - Package Manager
This is not a breaking change and is done in preparation to deprecate the bottomTabs.drawBehind option on iOS. Deprecate registerComponentWithRedux.
Read more >Twitter \ التغريدات مع الردود بواسطة React Native UI Lib (rnuilib@)
Turning up reanimated's benchmarks to test the new shared value implementation and it does not even sweat maintaining steady 60fps while the old...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I fixed the issue by updating my project’s
jest-setup.js:I added this code to fix the error above. But seems there is another issue occurs: code :
The
reading 'now'issue resolved by this fix:after comparing code 2.4.1 and 2.5.0. I think those 2 are bugs introduced by 2.5.0. Do we plan to have a fix?