forked from Path-Check/safeplaces-dct-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jestSetupFile.js
48 lines (46 loc) · 1.5 KB
/
jestSetupFile.js
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
43
44
45
46
47
48
import mockAsyncStorage from '@react-native-community/async-storage/jest/async-storage-mock';
jest.mock('@react-native-community/async-storage', () => mockAsyncStorage);
jest.mock(
'@react-native-community/push-notification-ios',
() => 'push-notification-ios',
);
jest.mock('react-native-share', () => 'Share');
jest.mock('rn-fetch-blob', () => 'Blob');
jest.mock('react-native-maps', () => 'MapView');
jest.mock('react-native-background-timer', () => 'BackgroundTimer');
jest.mock('react-native-permissions', () => 'Permissions');
jest.mock('react-native-popup-menu', () => ({
Menu: 'Menu',
MenuProvider: 'MenuProvider',
MenuOptions: 'MenuOptions',
MenuOption: 'MenuOption',
MenuTrigger: 'MenuTrigger',
}));
jest.mock('react-native-permissions', () => 'Permissions');
jest.mock('@react-navigation/native', () => {
return {
createAppContainer: jest
.fn()
.mockReturnValue(function NavigationContainer(props) {
return null;
}),
createDrawerNavigator: jest.fn(),
createMaterialTopTabNavigator: jest.fn(),
createStackNavigator: jest.fn(),
StackActions: {
push: jest
.fn()
.mockImplementation(x => ({ ...x, type: 'Navigation/PUSH' })),
replace: jest
.fn()
.mockImplementation(x => ({ ...x, type: 'Navigation/REPLACE' })),
},
NavigationActions: {
navigate: jest.fn().mockImplementation(x => x),
},
useNavigation: () => {
return { navigate: jest.fn() };
},
useFocusEffect: jest.fn(),
};
});