Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Your jest mock is breaking expo 52 and react-native 0.76 #369

Closed
retyui opened this issue Nov 18, 2024 · 3 comments · May be fixed by #370
Closed

[Bug] Your jest mock is breaking expo 52 and react-native 0.76 #369

retyui opened this issue Nov 18, 2024 · 3 comments · May be fixed by #370

Comments

@retyui
Copy link
Contributor

retyui commented Nov 18, 2024

This masterpiece have to be removed for RN 0.76

if (!global.__turboModuleProxy) {
global.__turboModuleProxy = name => {
return {};
};
}

To reproduce:

  1. Apply there steps from Readme: https://github.com/ammarahm-ed/react-native-mmkv-storage/tree/master/jest
  2. Create a simple test file
import {StyleSheet} from 'react-native';
test('test',() => {
  StyleSheet.create({a: {color:'red'}})
  // ^^^ TypeError: NativeModule.getConstants is not a function
})
@paulschreiber
Copy link

Can you update this and release a fix? This is blocking a Expo 52 upgrade.

@fredrikburmester
Copy link

I'd also like an update on this.

@retyui
Copy link
Contributor Author

retyui commented Jan 3, 2025

I would use a well maintained library https://github.com/mrousavy/react-native-mmkv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants