From 6710ff37f730dfa1fbd6f1b4e896da74df50e748 Mon Sep 17 00:00:00 2001 From: KostyaTretyak Date: Mon, 21 Sep 2020 15:28:49 +0300 Subject: [PATCH] fix(utils): MaybeMockedConstructor returns T At this point, `MaybeMockedConstructor` can return an empty object, causing the source type to be lost. This PR fixes this. --- src/utils/testing.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/testing.ts b/src/utils/testing.ts index e532e9a114..b826e10d6f 100644 --- a/src/utils/testing.ts +++ b/src/utils/testing.ts @@ -11,7 +11,7 @@ interface MockWithArgs extends jest.MockInstance = T extends new (...args: any[]) => infer R ? jest.MockInstance> - : {} // eslint-disable-line @typescript-eslint/ban-types + : T type MockedFunction = MockWithArgs & { [K in keyof T]: T[K] } type MockedFunctionDeep = MockWithArgs & MockedObjectDeep type MockedObject = MaybeMockedConstructor &