react-native-orientation-locker
react-native-orientation-locker copied to clipboard
Jest test fails in the context wrapper
Hi, i tried this fix it's working in the another pages but not working with context wrapper should i do another thing for this any idea ?
I'm using in the context wrapper like this:
I'm getting this error ->
@ozanmanav Try mocking the module in your tests:
jest.mock('react-native-orientation-locker', () => {
return {
addEventListener: jest.fn(),
removeEventListener: jest.fn(),
lockToPortrait: jest.fn(),
lockToLandscapeLeft: jest.fn(),
lockToLandscapeRight: jest.fn(),
unlockAllOrientations: jest.fn(),
};
});