[Jest] V2 - rc2 Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated'
See original GitHub issueDescription
I bumped RC 1
-> RC 2
in my project and suffered JEST error like the following
● Test suite failed to run
Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' could not be found. Verify that a module by this name is registered in the native binary.
at invariant (node_modules/invariant/invariant.js:40:15)
at Object.getEnforcing (node_modules/react-native/Libraries/TurboModule/TurboModuleRegistry.js:39:3)
at Object.<anonymous> (node_modules/react-native-reanimated/src/reanimated2/NativeReanimated.native.js:5:23)
at Object.<anonymous> (node_modules/react-native-reanimated/src/reanimated2/WorkletEventHandler.js:1:1)
My mock file is like that.
// @ts-ignore https://github.com/wcandillon/react-native-redash/issues/395
global.__reanimatedWorkletInit = () => {};
jest
.mock('react-native-reanimated', () => ({
...require('react-native-reanimated/mock'),
}))
.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
Expected behavior
Test should success
Package versions
- React:
16.13.1
- React Native:
0.63.4
- React Native Reanimated:
2.0.0-rc02
- NodeJS:
14.7.0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:24
- Comments:18 (4 by maintainers)
Top Results From Across the Web
Invariant Violation: TurboModuleRegistry.getEnforcing ...
'NativeReanimated' Cause - React Native Reanimated 2.0. I got this TurboModuleRegistry.getEnforcing(...): 'NativeReanimated' error and I ...
Read more >[Jest] V2 - rc2 Invariant Violation: TurboModuleRegistry ...
Description. I bumped RC 1 -> RC 2 in my project and suffered JEST error like the following ○ Test suite failed to...
Read more >'imageloader' could not be found. - You.com | The AI Search ...
getEnforcing 'ImageLoader' issue ... Invariant Violation: TurboModuleRegistry. ... software-mansion/react-native-reanimated[Jest] V2 - rc2 Invariant ...
Read more >'DevSettings' could not be found-React Native
Coding example for the question Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found-React Native.
Read more >react-native-reanimated - npm
React Native's Animated library reimplemented. Reanimated 2 is here! Check out our documentation page for more information. React Native ...
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 FreeTop 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
Top GitHub Comments
I opened a PR, but if you guys want a temporary fix. Use ds300/patch-package and put this on
patches/react-native-reanimated+2.0.0-rc.2.patch
:This is not only Jest related. Same happens when
Remote debugging issue indicates me Hermes comes into play. That is not viable on iOS for me 🤷♂️