-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathjest.setup.js
More file actions
28 lines (22 loc) · 809 Bytes
/
jest.setup.js
File metadata and controls
28 lines (22 loc) · 809 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
import nock from 'nock';
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';
nock.disableNetConnect();
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('react-i18next', () => ({
useTranslation: () => ({t: (key) => key}),
}));
jest.mock('react-native-bootsplash', () => {
return {
show: jest.fn().mockResolvedValueOnce(),
hide: jest.fn().mockResolvedValueOnce(),
getVisibilityStatus: jest.fn().mockResolvedValue('hidden'),
};
});
jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);
jest.mock('redux-persist', () => {
const real = jest.requireActual('redux-persist');
return {
...real,
persistReducer: jest.fn().mockImplementation((config, reducers) => reducers),
};
});