-
Notifications
You must be signed in to change notification settings - Fork 8k
/
actions_client.mock.ts
35 lines (31 loc) · 1009 Bytes
/
actions_client.mock.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
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { PublicMethodsOf } from '@kbn/utility-types';
import { ActionsClient } from './actions_client';
type ActionsClientContract = PublicMethodsOf<ActionsClient>;
export type ActionsClientMock = jest.Mocked<ActionsClientContract>;
const createActionsClientMock = () => {
const mocked: ActionsClientMock = {
create: jest.fn(),
get: jest.fn(),
delete: jest.fn(),
update: jest.fn(),
getAll: jest.fn(),
getBulk: jest.fn(),
execute: jest.fn(),
enqueueExecution: jest.fn(),
ephemeralEnqueuedExecution: jest.fn(),
listTypes: jest.fn(),
isActionTypeEnabled: jest.fn(),
};
return mocked;
};
export const actionsClientMock: {
create: () => ActionsClientMock;
} = {
create: createActionsClientMock,
};