forked from cryostatio/cryostat-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-setup.js
53 lines (52 loc) · 1.2 KB
/
test-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
41
42
43
44
45
46
47
48
49
50
51
52
53
// Mock out the services shared across the app in order to help isolate
// components from the ServiceContext
import '@i18n/config';
jest.mock('@app/Shared/Services/Api.service');
jest.mock('@app/Shared/Services/Login.service');
jest.mock('@app/Shared/Services/NotificationChannel.service');
jest.mock('@app/Shared/Services/Report.service');
jest.mock('@app/Shared/Services/Settings.service');
jest.mock('@app/Shared/Services/Target.service');
jest.mock('@app/Shared/Services/Targets.service');
jest.mock('@i18n/config', () => ({
...jest.requireActual('@test/i18n_config'),
__esModule: true
}));
jest.mock('@i18n/datetime', () => ({
...jest.requireActual('@i18n/datetime'),
__esModule: true,
supportedTimezones: () =>
[
{
full: 'UTC',
short: 'UTC',
},
{
full: 'America/Toronto',
short: 'EST',
},
],
defaultDatetimeFormat:
{
dateLocale: {
key: 'en',
name: 'English',
},
timeZone: {
full: 'UTC',
short: 'UTC',
},
},
locales: [
{
name: 'English',
key: 'en',
load: jest.fn()
},
{
name: 'French',
key: 'fr',
load: jest.fn()
}
]
}));