Closed CyganFx closed 1 year ago
Hey @CyganFx
I think the problem here is that you re-use controller for every t.Run instead of creating a new controller for each t.Run which is the correct way to do it.
But I agree that this should be mentioned in the docs.
Hi, when one executes tests in parallel with.GetMock ...'
t.Parallel()
, and does something like:defer mockController.Finish()
(similar withWait(<duration>)
) controller fails to recognize that some of mocks' Expect/Return and other patterns are not used. Without parallel tests, there would be error like: 'Expected to callTo fix that, you need to use
Cleanup
method oftesting.T
and inside it call whetherFinish
orWait
.Could be implemented like in this issue https://github.com/gojuno/minimock/issues/62
I think it'd be useful to add it in README, as go official docs aren't much informative