-
-
Notifications
You must be signed in to change notification settings - Fork 145
/
jest.setup.ts
42 lines (41 loc) · 1.15 KB
/
jest.setup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import * as ReactNative from 'react-native';
jest.doMock('react-native', () => {
return Object.setPrototypeOf(
{
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: {
...ReactNative.TurboModuleRegistry,
getEnforcing: () => {
return {
initialize: jest.fn(),
setRequestConfiguration: jest.fn(),
openAdInspector: jest.fn(),
openDebugMenu: jest.fn(),
setAppVolume: jest.fn(),
setAppMuted: jest.fn(),
};
},
},
},
ReactNative,
);
});