-
Notifications
You must be signed in to change notification settings - Fork 0
/
jest-setup.js
43 lines (39 loc) · 1.35 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
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-call */
import "react-native-gesture-handler/jestSetup";
import "@testing-library/react-native/extend-expect";
import React from "react";
import { setUpTests } from "react-native-reanimated";
import mockSafeAreaContext from "react-native-safe-area-context/jest/mock";
setUpTests();
jest.mock("react-native-safe-area-context", () => mockSafeAreaContext);
jest.mock("@gorhom/bottom-sheet", () => {
const RN = jest.requireActual("react-native");
const BottomSheetModal = ({
backdropComponent,
handleComponent,
footerComponent,
children,
...props
}) => {
return (
<RN.View {...props}>
{backdropComponent && backdropComponent()}
{handleComponent && handleComponent()}
{children}
{footerComponent && footerComponent()}
</RN.View>
);
};
return {
__esModule: true,
...jest.requireActual("@gorhom/bottom-sheet/mock"),
...jest.requireActual("react-native-reanimated/mock"),
TouchableOpacity: jest.requireActual("react-native").TouchableOpacity,
BottomSheetBackdrop: jest.requireActual("react-native").View,
BottomSheetHandle: jest.requireActual("react-native").View,
BottomSheetFooter: jest.requireActual("react-native").View,
BottomSheetModal,
};
});
export {};