-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.js
53 lines (45 loc) · 1.57 KB
/
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
import 'react-native-gesture-handler/jestSetup';
import mockAsyncStorage from '@react-native-async-storage/async-storage/jest/async-storage-mock';
global.__reanimatedWorkletInit = jest.fn();
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
// The mock for `call` immediately calls the callback which is incorrect
// So we override it with a no-op
Reanimated.default.call = () => {
};
return Reanimated;
});
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('@react-native-async-storage/async-storage', () => mockAsyncStorage);
jest.mock('@gorhom/bottom-sheet', () => {
const React = require('react');
const RN = require('react-native');
const BottomSheetModalContext = React.createContext(null);
const BottomSheetModalProvider = (props) => {
return <BottomSheetModalContext.Provider {...props} value={{}} />;
};
return {
__esModule: true,
default: RN.View,
BottomSheetScrollView: RN.ScrollView,
BottomSheetModalProvider,
namedExport: {
...require('react-native-reanimated/mock'),
...jest.requireActual('@gorhom/bottom-sheet'),
},
};
});
jest.mock('@ledgerhq/react-native-hw-transport-ble', () => {
return {};
});
jest.mock('react-native-ble-plx', () => {
return {};
});
jest.mock('@/components/login/ledger/LedgerConnect', () => {
const RN = require('react-native');
return {
__esModule: true,
default: RN.View,
};
});