forked from XRPL-Labs/Xaman-App
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
23 lines (18 loc) · 774 Bytes
/
jest.setup.js
File metadata and controls
23 lines (18 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import Locale from '@locale';
import moment from 'moment-timezone';
const logs = process.env?.LOGS ?? false;
/* Hide console in jest tests */
if (logs) {
jest.spyOn(global.console, 'log').mockImplementation(() => jest.fn());
jest.spyOn(global.console, 'error').mockImplementation(() => jest.fn());
jest.spyOn(global.console, 'debug').mockImplementation(() => jest.fn());
jest.spyOn(global.console, 'warn').mockImplementation(() => jest.fn());
}
/* Mock RNN event listeners */
jest.mock('react-native/Libraries/EventEmitter/NativeEventEmitter.js');
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
/* Realm */
process.env.REALM_DISABLE_ANALYTICS = true;
// Localization
Locale.setLocale('EN');
moment.tz.setDefault('Europe/Amsterdam');