[Feature]: support type inference for function parameters expect(someFunction).toBeCalledWith()
#13267
Labels
expect(someFunction).toBeCalledWith()
#13267
🚀 Feature Proposal
When using the following code:
The type expected as arguments for
toBeCalledWith
isany[]
This can be overridden by passing a type argument:
My proposal is to have it inferred automatically by default.
https://www.typescriptlang.org/docs/handbook/utility-types.html#parameterstype
Similar methods should also be updated (e.g.
toHaveBeenCalledWith
,lastCalledWith
)Motivation
When using
toBeCalledWith
, users will get instant feedback and auto-completion for the arguments passed.Example
No response
Pitch
It will improve the DX of using jest.
The text was updated successfully, but these errors were encountered: