Skip to content

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

Closed
@retyui

Description

@retyui

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
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions