-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathjestSetup.js
61 lines (48 loc) · 1.24 KB
/
jestSetup.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
49
50
51
52
53
54
55
56
57
58
59
60
61
/* global jest */
import NavigationHolder from './src/NavigationHolder';
jest.mock('react-native/Libraries/AppState/AppState', () => ({
currentState: 'active',
}));
jest.mock('react-native-localize', () => ({
findBestLanguageTag: () => ({ languageTag: 'en' }),
}));
jest.mock('react-native-blob-util', () => ({
fetch: () => {},
wrap: () => {},
}));
jest.mock('expo-file-system', () => ({
createUploadTask: jest.fn(),
FileSystemUploadType: {
MULTIPART: 1,
},
FileSystemSessionType: {
BACKGROUND: 0,
},
}));
jest.mock('@react-native-firebase/analytics', () => ({
logEvent: jest.fn(),
setUserProperty: jest.fn(),
}));
jest.mock('@react-native-firebase/messaging', () => ({}));
jest.mock('react-native-background-geolocation', () => ({
DESIRED_ACCURACY_HIGH: -1,
LOG_LEVEL_VERBOSE: 5,
LOG_LEVEL_OFF: 0,
onEnabledChange: jest.fn(),
ready: jest.fn(),
start: jest.fn(),
stop: jest.fn(),
removeListeners: jest.fn(),
changePace: jest.fn(),
}));
jest.mock('@stripe/stripe-react-native', () => ({}));
jest.mock('react-native-share', () => ({}));
jest.mock('uuid', () => ({
v4: jest.fn(),
}));
const fakeNavigator = {
current: {
dispatch: action => {},
},
};
NavigationHolder.setNavigationRef(fakeNavigator);