-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest-setup.js
More file actions
37 lines (32 loc) · 962 Bytes
/
jest-setup.js
File metadata and controls
37 lines (32 loc) · 962 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
37
// Mock AsyncStorage before any imports
jest.mock('@react-native-async-storage/async-storage', () =>
require('@react-native-async-storage/async-storage/jest/async-storage-mock')
);
// Mock other React Native modules that might cause issues in tests
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter');
// Mock Firebase modules
jest.mock('@react-native-firebase/app', () => ({
utils: () => ({
FilePath: {
PICTURES_DIRECTORY: '/tmp',
},
}),
}));
jest.mock('@react-native-firebase/analytics', () => ({
logEvent: jest.fn(),
setUserId: jest.fn(),
setUserProperties: jest.fn(),
}));
// Mock Expo modules
jest.mock('expo-router', () => ({
useRouter: () => ({
push: jest.fn(),
replace: jest.fn(),
back: jest.fn(),
}),
useLocalSearchParams: () => ({}),
Link: ({ children }) => children,
}));
jest.mock('expo-linking', () => ({
createURL: jest.fn(),
}));