-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
33 lines (30 loc) · 835 Bytes
/
jest.setup.js
File metadata and controls
33 lines (30 loc) · 835 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
/* eslint-env jest */
// Mock react-native-screens
jest.mock('react-native-screens', () => ({
enableScreens: jest.fn(),
}));
// Mock @react-navigation/native
jest.mock('@react-navigation/native', () => ({
NavigationContainer: ({ children }) => children,
useNavigation: () => ({
navigate: jest.fn(),
goBack: jest.fn(),
}),
useRoute: () => ({
params: {},
}),
}));
// Mock @react-navigation/native-stack
jest.mock('@react-navigation/native-stack', () => ({
createNativeStackNavigator: () => ({
Navigator: ({ children }) => children,
Screen: ({ children }) => children,
}),
}));
// Mock @react-navigation/bottom-tabs
jest.mock('@react-navigation/bottom-tabs', () => ({
createBottomTabNavigator: () => ({
Navigator: ({ children }) => children,
Screen: ({ children }) => children,
}),
}));