-
Notifications
You must be signed in to change notification settings - Fork 266
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
Received method does not store the original parameters of the call #851
Comments
Hi @sashafp10 , Thanks for raising this and the great repro case. We've encountered this before. The issue is that storing deep copies of parameters on every call is terrible for performance. Very open to suggestions on how to deal with this. 🙇 One alternative is using |
Hello @dtchepak , Thanks for the reply. Please let me know your thoughts on this. |
I really think the best of the admittedly non-ideal options is for people to configure whatever copying behaviour they want using |
Thanks. My point was to make it more straightforward. More of a suggestion. |
Describe the bug
When I mock a method that accepts some objects as parameters more than once, I would have expected a number of invocations, but the parameters would be incorrect for each invocation except the last one.
To Reproduce
In the test log you would see that all invocations are with the same parameters.
Expected behaviour
In the test log, you will see that all invocations have the same parameters. I should not need to change the main implementation to fit the tests.
Environment:
Additional context
The current behavior can be explained easily because I mutate my parameter object during the main functionality. However, this should not affect the invocation history.
The text was updated successfully, but these errors were encountered: