backend-test-utils: remove last type parameter for MockInstance
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/backend-test-utils': patch
|
||||
---
|
||||
|
||||
Remove third type parameter used for `MockInstance`, in order to be compatible with older versions of `@types/jest`.
|
||||
@@ -210,10 +210,9 @@ export type ServiceMock<TService> = {
|
||||
factory: ServiceFactory<TService>;
|
||||
} & {
|
||||
[Key in keyof TService]: TService[Key] extends (
|
||||
this: infer This,
|
||||
...args: infer Args
|
||||
) => infer Return
|
||||
? TService[Key] & jest.MockInstance<Return, Args, This>
|
||||
? TService[Key] & jest.MockInstance<Return, Args>
|
||||
: TService[Key];
|
||||
};
|
||||
|
||||
|
||||
@@ -64,10 +64,9 @@ export type ServiceMock<TService> = {
|
||||
factory: ServiceFactory<TService>;
|
||||
} & {
|
||||
[Key in keyof TService]: TService[Key] extends (
|
||||
this: infer This,
|
||||
...args: infer Args
|
||||
) => infer Return
|
||||
? TService[Key] & jest.MockInstance<Return, Args, This>
|
||||
? TService[Key] & jest.MockInstance<Return, Args>
|
||||
: TService[Key];
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user