-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
32 lines (29 loc) · 754 Bytes
/
jest.setup.js
File metadata and controls
32 lines (29 loc) · 754 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
// React Native 모듈들을 mock 처리
jest.mock('react-native', () => ({
Alert: {
alert: jest.fn(),
},
Dimensions: {
get: jest.fn(() => ({ width: 375, height: 812 })),
},
}));
jest.mock('react-native-maps', () => ({
Region: {},
}));
jest.mock('expo-location', () => ({
requestForegroundPermissionsAsync: jest.fn(() =>
Promise.resolve({ status: 'granted' })
),
getCurrentPositionAsync: jest.fn(() =>
Promise.resolve({
coords: {
latitude: 37.5665,
longitude: 126.978,
},
})
),
}));
// API 함수 mock
jest.mock('./src/apis/searchNearbyPlaces', () => ({
searchNearbyPlaces: jest.fn(() => Promise.resolve([])),
}));