-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
29 lines (25 loc) · 721 Bytes
/
jest.setup.js
File metadata and controls
29 lines (25 loc) · 721 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
const Platform = {
OS: 'ios',
select: (obj) => obj.ios ?? obj.default,
};
const Linking = {
canOpenURL: jest.fn().mockResolvedValue(true),
openURL: jest.fn().mockResolvedValue(undefined),
};
const NativeModules = {
NativeUpdates: {
currentVersion: '1.0.0',
buildNumber: '1',
packageName: 'com.test.app',
country: 'us',
getAppStoreVersion: jest.fn(),
checkPlayStoreUpdate: jest.fn(),
startUpdate: jest.fn(),
completeUpdate: jest.fn(),
},
};
const NativeEventEmitter = jest.fn().mockImplementation(() => ({
addListener: jest.fn(() => ({ remove: jest.fn() })),
removeAllListeners: jest.fn(),
}));
module.exports = { Platform, Linking, NativeModules, NativeEventEmitter };