-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathjest.setup.js
35 lines (30 loc) · 1014 Bytes
/
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
import { NativeModules, UIManager, StyleSheet, Dimensions } from 'react-native';
import 'react-native-mock-render/mock';
import 'react-native/Libraries/Animated/src/bezier'; // for https://github.com/facebook/jest/issues/4710
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import 'react-native-gesture-handler';
import { Utils } from 'tuya-panel-utils';
const { winWidth, winHeight } = Utils.RatioUtils;
NativeModules.TYRCTPublicModule = {};
NativeModules.TYRCTDeviceModule = {};
NativeModules.TYRCTPublicManager = {};
NativeModules.TYRCTPanelManager = {};
NativeModules.RNGestureHandlerModule = {
Direction: {},
};
UIManager.getViewManagerConfig = () => {};
StyleSheet.compose = () => {};
Dimensions.get = () => ({
width: winWidth,
height: winHeight,
});
jest.mock('react-native-gesture-handler', () => {
return {
BaseButton: () => 'BaseButton',
};
});
// jest.mock('Dimensions', () => {
// return Dimensions;
// });
Enzyme.configure({ adapter: new Adapter() });