testify icon indicating copy to clipboard operation
testify copied to clipboard

[Feature Request] Create mock.AnyArgs

Open sonalys opened this issue 3 years ago • 0 comments

Scenario: I have a function that is used in a lot of places, and I have to change the function signature, adding a new parameter. All of the mocks of this function are used with func(mock.Anything) because I dont want to validate the argument during the tests. when I add a new argument, I have to go through hundreds of calls to func and add another mock.Anything.

Proposition: It would be very nice to have a fallback for this usecase, something like mock.IgnoreArgs or whatever, so the expectation will not fail and I will get the return I want, without having to refactor hundreds of calls for this function inside tests.

sonalys avatar Mar 15 '22 10:03 sonalys