forked from react-navigation/drawer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest-setup.js
66 lines (63 loc) · 1.49 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/* eslint-env jest */
// eslint-disable-next-line import/no-unresolved
import NativeModules from 'NativeModules';
Object.assign(NativeModules, {
RNGestureHandlerModule: {
attachGestureHandler: jest.fn(),
createGestureHandler: jest.fn(),
dropGestureHandler: jest.fn(),
updateGestureHandler: jest.fn(),
State: {},
Directions: {},
},
ReanimatedModule: {
createNode: jest.fn(),
configureProps: jest.fn(),
configureNativeProps: jest.fn(),
connectNodes: jest.fn(),
disconnectNodes: jest.fn(),
addListener: jest.fn(),
removeListeners: jest.fn(),
},
PlatformConstants: {
forceTouchAvailable: false,
},
});
jest.mock('react-native-reanimated', () => ({
__esModule: true,
default: {
Code: () => null,
View: require('react-native').Animated.View,
Text: require('react-native').Animated.Text,
Clock: jest.fn(),
Value: jest.fn(),
onChange: jest.fn(),
interpolate: jest.fn(),
abs: jest.fn(),
add: jest.fn(),
sub: jest.fn(),
and: jest.fn(),
block: jest.fn(),
call: jest.fn(),
clockRunning: jest.fn(),
cond: jest.fn(),
divide: jest.fn(),
eq: jest.fn(),
event: jest.fn(),
greaterThan: jest.fn(),
lessThan: jest.fn(),
max: jest.fn(),
min: jest.fn(),
multiply: jest.fn(),
neq: jest.fn(),
or: jest.fn(),
set: jest.fn(),
spring: jest.fn(),
startClock: jest.fn(),
stopClock: jest.fn(),
timing: jest.fn(),
},
Easing: {
out: jest.fn(),
},
}));