-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest.setup.js
33 lines (24 loc) · 1.06 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
import {setLanguageToI18n} from '@/locale';
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';
import '@testing-library/jest-native/extend-expect';
import 'react-native-gesture-handler/jestSetup';
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
Reanimated.default.call = () => {};
return Reanimated;
});
jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);
jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
jest.mock('react-native', () => {
const RN = jest.requireActual('react-native');
RN.NativeModules.SettingsManager = {settings: {AppleLocale: 'en_US'}};
RN.NativeModules.I18nManager = {localeIdentifier: 'en_US'};
return RN;
});
jest.mock('react-native-flash-message', () => ({
showMessage(options) {},
}));
mockAsyncStorage.setItem = jest.fn((_key, _value) => {});
mockAsyncStorage.getItem = jest.fn((_key) => {});
setLanguageToI18n();