-
Notifications
You must be signed in to change notification settings - Fork 1
/
jest-setup.js
40 lines (34 loc) · 1.04 KB
/
jest-setup.js
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
// @flow
import {NativeModules} from 'react-native';
// monkey patching the locale to avoid the error:
// Something went wrong initializing the native ReactLocalization module
NativeModules.ReactLocalization = {
language: 'en_US',
};
/*jest.mock('Platform', () => {
const Platform = require.requireActual('Platform');
Object.assign( Platform , {'mockPlatform' : ''});
Platform.OS = Platform['mockPlatform'];
return Platform;
});*/
jest.mock('react-native-code-push', () => {
const cp = () => (app) => app;
Object.assign(cp, {
InstallMode: {},
CheckFrequency: {},
SyncStatus: {},
UpdateState: {},
DeploymentStatus: {},
DEFAULT_UPDATE_DIALOG: {},
checkForUpdate: jest.fn(),
codePushify: jest.fn(),
getConfiguration: jest.fn(),
getCurrentPackage: jest.fn(),
getUpdateMetadata: jest.fn(),
log: jest.fn(),
notifyAppReady: jest.fn(),
notifyApplicationReady: jest.fn(),
sync: jest.fn(),
});
return cp;
});