-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjest-setup.js
29 lines (25 loc) · 934 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
/// Jest Mock Modules
/// mocking react-native-reanimated
require('react-native-reanimated/lib/reanimated2/jestUtils').setUpTests();
global.console = {
...console,
// log: jest.fn(),
debug: jest.fn(),
warn: jest.fn(),
error: jest.fn(),
};
global.__reanimatedWorkletInit = jest.fn();
// mocking RNgesture handler
import { NativeModules as RNNativeModules } from "react-native";
RNNativeModules.UIManager = RNNativeModules.UIManager || {};
RNNativeModules.UIManager.RCTView = RNNativeModules.UIManager.RCTView || {};
RNNativeModules.RNGestureHandlerModule = RNNativeModules.RNGestureHandlerModule || {
State: { BEGAN: "BEGAN", FAILED: "FAILED", ACTIVE: "ACTIVE", END: "END" },
attachGestureHandler: jest.fn(),
createGestureHandler: jest.fn(),
dropGestureHandler: jest.fn(),
updateGestureHandler: jest.fn(),
};
RNNativeModules.PlatformConstants = RNNativeModules.PlatformConstants || {
forceTouchAvailable: false
};