forked from thisisqubika/react-native-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
38 lines (32 loc) · 951 Bytes
/
jest.setup.js
File metadata and controls
38 lines (32 loc) · 951 Bytes
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
import { NativeModules } from 'react-native';
NativeModules.ReactLocalization = {
language: 'en',
};
global.__reanimatedWorkletInit = jest.fn();
jest.mock('react-native-reanimated', () => ({
...jest.requireActual('react-native-reanimated/mock'),
useSharedValue: jest.fn,
useAnimatedStyle: jest.fn,
withTiming: jest.fn,
withSpring: jest.fn,
withRepeat: jest.fn,
withSequence: jest.fn,
useAnimatedProps: jest.fn,
Easing: {
linear: jest.fn,
elastic: jest.fn,
},
}));
jest.mock('react-native-bootsplash', () => ({
hide: jest.fn().mockResolvedValueOnce(),
show: jest.fn().mockResolvedValueOnce(),
getVisibilityStatus: jest.fn().mockResolvedValue('hidden'),
}));
jest.mock('react-native-config', () => ({
Config: {
API_BASE_URL: 'XXX',
BUILD_VARIANT: 'TEST',
},
}));
// Silence the warning: Animated: `useNativeDriver` is not supported
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');