2020-09-15 12:41:27 +02:00
|
|
|
/*
|
2021-01-20 02:52:56 +01:00
|
|
|
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
|
|
|
|
* or more contributor license agreements. Licensed under the Elastic License
|
|
|
|
* and the Server Side Public License, v 1; you may not use this file except in
|
|
|
|
* compliance with, at your election, the Elastic License or the Server Side
|
|
|
|
* Public License, v 1.
|
2020-09-15 12:41:27 +02:00
|
|
|
*/
|
2021-01-20 02:52:56 +01:00
|
|
|
|
2020-10-27 21:18:30 +01:00
|
|
|
export type DeeplyMockedKeys<T> = {
|
2020-09-15 12:41:27 +02:00
|
|
|
[P in keyof T]: T[P] extends (...args: any[]) => any
|
|
|
|
? jest.MockInstance<ReturnType<T[P]>, Parameters<T[P]>>
|
|
|
|
: DeeplyMockedKeys<T[P]>;
|
|
|
|
} &
|
|
|
|
T;
|
|
|
|
|
2020-10-27 21:18:30 +01:00
|
|
|
export type MockedKeys<T> = { [P in keyof T]: jest.Mocked<T[P]> };
|