diff --git a/jestSetup.js b/jestSetup.js new file mode 100644 index 00000000..e59dcf06 --- /dev/null +++ b/jestSetup.js @@ -0,0 +1,8 @@ +jest.mock("react-native-ios-context-menu", () => { + const RN = jest.requireActual("react-native"); + + return { + RCTContextMenuView: () => RN.View, + ContextMenuButton: "TouchableOpacity", + }; +}); diff --git a/package.json b/package.json index f32a2e48..043d385b 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,8 @@ "!**/__tests__", "!**/__fixtures__", "!**/__mocks__", - "!**/.*" + "!**/.*", + "jestSetup.js" ], "scripts": { "example": "yarn workspace react-native-ios-context-menu-example",