From dd6c6db14887db4adb452158a5c4ec1b10a61162 Mon Sep 17 00:00:00 2001 From: Tyler Williams Date: Tue, 26 Nov 2024 19:42:49 -0700 Subject: [PATCH] feat: export jestSetup for mocks --- jestSetup.js | 8 ++++++++ package.json | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 jestSetup.js 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",