Created
February 12, 2021 12:24
-
-
Save devxoul/2470473d8df4d0db9f20c2fa0aaa8fa3 to your computer and use it in GitHub Desktop.
Jest Spy type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Spy<T extends {}, M extends jest.FunctionPropertyNames<Required<T>>> = Required<T>[M] extends (...args: any[]) => any | |
? jest.SpyInstance<ReturnType<Required<T>[M]>, jest.ArgsType<Required<T>[M]>> | |
: never; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment