-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathsetupTests.ts
57 lines (55 loc) · 1.93 KB
/
setupTests.ts
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
54
55
56
57
import { SendgridData } from '@hyperjumptech/monika/lib/interfaces/data';
import { Probe } from '@hyperjumptech/monika/lib/interfaces/probe';
import { NotificationContextInterface } from './contexts/notification-context-interface';
import { ProbeContextInterface } from './contexts/probe-context-interface';
jest.mock(
'./contexts/notification-context',
() =>
<NotificationContextInterface>{
notificationData: [
{
id: 'anu-id',
type: 'sendgrid',
data: <SendgridData>{ apiKey: 'yyyyy' },
},
],
handleSetNotifications: () => undefined,
handleAddNotification: () => undefined,
handleRemoveNotification: () => undefined,
handleUpdateNotificationType: () => undefined,
handleUpdateNotificationData: () => undefined,
}
);
jest.mock(
'./contexts/probe-context',
() =>
<ProbeContextInterface>{
probeData: [
<Probe>{
id: 'fake-id',
name: 'fake-probe',
incidentThreshold: 3,
recoveryThreshold: 3,
alerts: [{}],
requests: [{}],
},
],
handleSetProbes: () => undefined,
handleAddProbe: () => undefined,
handleAddProbeRequest: () => undefined,
handleAddProbeRequestHeader: () => undefined,
handleUpdateProbeData: () => undefined,
handleUpdateProbeRequestPosition: () => undefined,
handleUpdateProbeRequestEnableBody: () => undefined,
handleUpdateProbeRequestData: () => undefined,
handleUpdateProbeRequestBody: () => undefined,
handleUpdateProbeRequestHeaderKey: () => undefined,
handleUpdateProbeRequestHeaderValue: () => undefined,
handleRemoveProbeRequest: () => undefined,
handleRemoveProbe: () => undefined,
handleRemoveProbeRequestHeader: () => undefined,
handleAddProbeAlert: () => undefined,
handleUpdateProbeAlert: () => undefined,
handleRemoveProbeAlert: () => undefined,
}
);