You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a toHaveBeenCalledTimesWith, but this doesn't assert the same thing, it allows other calls.
Rather than add a local extension to our projects, it would be amazing if something could be added to the lib that we could switch to in order to remove a bunch of unneeded calls.
Motivation
Allows for cleaner assertions on a common use case.
Such a method would also encourage more strict tests as many folks tend to just use toHaveBeenCalledWith which doesn't fail when there are unexpected calls.
In environment like React where re-rendering is automatically triggered, it's very easy to assert that "X" was called with "true", only for it to be immediately followed up with a "false", and toHaveBeenCalledWith would be providing false confidence.
The text was updated successfully, but these errors were encountered:
馃殌 Feature Proposal
Our codebase is littered with:
There is a
toHaveBeenCalledTimesWith
, but this doesn't assert the same thing, it allows other calls.Rather than add a local extension to our projects, it would be amazing if something could be added to the lib that we could switch to in order to remove a bunch of unneeded calls.
Motivation
Allows for cleaner assertions on a common use case.
Example
Pitch
Such a method would also encourage more strict tests as many folks tend to just use
toHaveBeenCalledWith
which doesn't fail when there are unexpected calls.In environment like React where re-rendering is automatically triggered, it's very easy to assert that "X" was called with "true", only for it to be immediately followed up with a "false", and
toHaveBeenCalledWith
would be providing false confidence.The text was updated successfully, but these errors were encountered: