react-native-ios-context-menu icon indicating copy to clipboard operation
react-native-ios-context-menu copied to clipboard

support unit testing via jest

Open und3f1n3d opened this issue 4 years ago • 0 comments

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

und3f1n3d avatar Feb 23 '21 22:02 und3f1n3d