react-native-ios-context-menu
react-native-ios-context-menu copied to clipboard
support unit testing via jest
Hello!
I must say this is a great library to have. It would be nice to a provide jestSetup.js file for this.
Right now i am mocking the library like this, and hopefully it won't return any issue when you make more changes in the future. Also I had to look thru the ActionSheetFallback function if there was a reject function that comes with. It's good that it never returns reject but a jestSetup.js will sorta help, i guess?! Anyway, thanks for effort in this library. :)
jest.mock('react-native-ios-context-menu', () => {
const RN = jest.requireActual('react-native');
return {
RCTContextMenuView: () => RN.View,
ContextMenuButton: 'TouchableOpacity'
};
});