New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add functionality to safe mock functions #17
Comments
Hey. I'm in 2 minds about this. I feel that jest already provides this functionality already. I haven't checked, but assume jest.fn does not have a generic Param for doing this? |
Hi @marchaos, The following example can't be achieved by jest type MyFn = (x: number, y: number) => Promise<string>;
const fn = mockFn<MyFn>();
fn.calledWith(1, 2).mockReturnValue('str'); |
Yep. Makes sense. I'll merge this in for now, but am planning on adding "mock" to the best object as "mockType" so might need to do something similar with this at that point. I will keep it backwards compatible! |
add functionality to safe mock functions #17
* ⬆️ Update dependencies * ♻️ Do not use vitest global
Example of the feature:
The text was updated successfully, but these errors were encountered: