-
Notifications
You must be signed in to change notification settings - Fork 2
/
jest.setup.js
executable file
·75 lines (62 loc) · 1.6 KB
/
jest.setup.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import {jest} from '@jest/globals';
import mockBottomSheet from '@gorhom/bottom-sheet/mock';
import mockRNDeviceInfo from 'react-native-device-info/jest/react-native-device-info-mock';
jest.useFakeTimers();
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
Reanimated.default.call = () => {};
return Reanimated;
});
jest.mock('@gorhom/bottom-sheet', () => ({
...mockBottomSheet,
__esModule: true,
}));
jest.mock('react-native-flipper', () => {
return {
addPlugin: jest.fn(),
};
});
jest.mock('react-native-device-info', () => mockRNDeviceInfo);
jest.mock('@react-navigation/stack', () => {
return {
createStackNavigator: jest.fn().mockReturnValue({
Navigator: 'Navigator',
Screen: 'Screen',
}),
TransitionPresets: {
SlideFromRightIOS: 'SlideFromRightIOS',
},
HeaderStyleInterpolators: {
forUIKit: 'forUIKit',
},
};
});
jest.mock('@react-navigation/elements', () => {
return {
useHeaderHeight: jest.fn().mockReturnValue(0),
};
});
jest.mock('@react-navigation/devtools', () => {
return {
useFlipper: jest.fn(),
};
});
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock'),
);
jest.mock('uuid', () => {
return {
v4: jest.fn().mockReturnValue('uuid'),
};
});
jest.mock('react-native-image-progress', () => {
return {
Image: 'Image',
};
});
jest.mock('react-native-progress', () => {
return {
Bar: 'Bar',
};
});