-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
36 lines (30 loc) · 1003 Bytes
/
jest.setup.js
File metadata and controls
36 lines (30 loc) · 1003 Bytes
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
// Mock expo libraries and other native modules
jest.mock("expo-router", () => ({
usePathname: jest.fn(() => ""),
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
}));
jest.mock("expo-linear-gradient", () => ({
LinearGradient: "LinearGradient",
}));
jest.mock("react-native-responsive-screen", () => ({
heightPercentageToDP: jest.fn((val) => val),
widthPercentageToDP: jest.fn((val) => val),
}));
jest.mock("@expo/vector-icons", () => ({
Ionicons: "Ionicons",
}));
jest.mock("react-native-safe-area-context", () => {
const inset = { top: 0, right: 0, bottom: 0, left: 0 };
return {
SafeAreaProvider: ({ children }) => children,
SafeAreaView: ({ children }) => children,
useSafeAreaInsets: () => inset,
};
});
jest.mock("@react-native-async-storage/async-storage", () => require("@react-native-async-storage/async-storage/jest/async-storage-mock"));
// Set up global environment variables if needed
global.fetch = jest.fn();