-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
58 lines (50 loc) · 1.37 KB
/
Copy pathjest.setup.js
File metadata and controls
58 lines (50 loc) · 1.37 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Silence various warnings
global.__DEV__ = true;
// Mock console methods
global.console = {
...console,
warn: jest.fn(),
error: jest.fn(),
};
// Mock expo modules completely
jest.mock('expo', () => ({}));
jest.mock('expo-status-bar', () => ({
StatusBar: 'StatusBar',
}));
jest.mock('expo-constants', () => ({
default: {
statusBarHeight: 20,
},
}));
// Mock specific problematic imports
global.__ExpoImportMetaRegistry = {};
// Mock React Navigation
jest.mock('@react-navigation/native', () => ({
useNavigation: () => ({
navigate: jest.fn(),
goBack: jest.fn(),
}),
useFocusEffect: jest.fn(),
}));
// Mock AsyncStorage
jest.mock('@react-native-async-storage/async-storage', () => ({
getItem: jest.fn(() => Promise.resolve(null)),
setItem: jest.fn(() => Promise.resolve()),
removeItem: jest.fn(() => Promise.resolve()),
clear: jest.fn(() => Promise.resolve()),
}));
// Mock other libraries
jest.mock('react-native-calendars', () => ({
Calendar: 'Calendar',
CalendarList: 'CalendarList',
Agenda: 'Agenda',
}));
jest.mock('react-native-countdown-component', () => 'CountDown');
jest.mock('react-native-swiper', () => 'Swiper');
// Mock React Native components that may cause issues
jest.mock('react-native-gesture-handler', () => ({
PanGestureHandler: 'PanGestureHandler',
TapGestureHandler: 'TapGestureHandler',
State: {},
Directions: {},
}));