From b7712b2055d8f32dd97999de1d94e8f3515d79e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=81=D1=82=D1=8F=20=D0=A2=D1=80=D0=B5=D1=82?= =?UTF-8?q?=D1=8F=D0=BA?= Date: Mon, 21 Sep 2020 16:33:02 +0300 Subject: [PATCH] fix(utils): `MaybeMockedConstructor` returns T (#1976) 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 &