react-native-google-mobile-ads
Version:
React Native Google Mobile Ads is an easy way to monetize mobile apps with targeted, in-app advertising.
46 lines (44 loc) • 1.21 kB
text/typescript
import * as ReactNative from 'react-native';
jest.doMock('react-native', () => {
return Object.setPrototypeOf(
{
Platform: {
OS: 'android',
select: () => {},
},
NativeModules: {
...ReactNative.NativeModules,
RNAppModule: {
addListener: jest.fn(),
removeListeners: jest.fn(),
eventsAddListener: jest.fn(),
eventsNotifyReady: jest.fn(),
},
RNGoogleMobileAdsModule: {
addListener: jest.fn(),
removeListeners: jest.fn(),
eventsAddListener: jest.fn(),
eventsNotifyReady: jest.fn(),
},
RNGoogleMobileAdsInterstitialModule: {
interstitialLoad: jest.fn(),
},
RNGoogleMobileAdsRewardedModule: {},
RNGoogleMobileAdsConsentModule: {},
},
TurboModuleRegistry: {
getEnforcing: () => {
return {
initialize: jest.fn(),
setRequestConfiguration: jest.fn(),
openAdInspector: jest.fn(),
openDebugMenu: jest.fn(),
setAppVolume: jest.fn(),
setAppMuted: jest.fn(),
};
},
},
},
ReactNative,
);
});