I want something like the following (that actually works...):
import { NativeModules } from 'react-native';
import PushNotifications from '../../app/platform/PushNotificationSupport';
const mockRNA = jest.requireMock('react-native');
jest.mock('react-native', () => {
return {
default: mockRNA.default,
NativeModules: {
...mockRNA.NativeModules,
NativePushNotifications: {
setTokenHandler: jest.fn(),
},
},
};
});
Of course, the above code doesn't actually work. I essentially want to build on top of the existing react-native
mock.