-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
jest.setup.js
21 lines (16 loc) · 845 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
/* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable no-undef */
import "react-native-gesture-handler/jestSetup";
import "@testing-library/jest-native/extend-expect";
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");
// fixing `ReferenceError: You are trying to `import` a file after the Jest environment has been torn down.`
jest.useFakeTimers();