-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjestSetupFile.js
30 lines (24 loc) · 1.13 KB
/
jestSetupFile.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
import mockAsyncStorage from "@react-native-async-storage/async-storage/jest/async-storage-mock";
// eslint-disable-next-line no-undef
jest.mock("@react-native-async-storage/async-storage", () => mockAsyncStorage);
// StatusBar mock
// eslint-disable-next-line no-undef
jest.mock("react-native/Libraries/Components/StatusBar/StatusBar", () =>
// eslint-disable-next-line no-undef
jest.genMockFromModule(
"react-native/Libraries/Components/StatusBar/StatusBar"
)
);
// eslint-disable-next-line no-undef
jest.mock("react-native-reanimated", () => {
// eslint-disable-next-line @typescript-eslint/no-var-requires
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
// eslint-disable-next-line @typescript-eslint/no-empty-function
Reanimated.default.call = () => {};
return Reanimated;
});
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
// eslint-disable-next-line no-undef
jest.mock("react-native/Libraries/Animated/src/NativeAnimatedHelper");