-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
First execution of a spy as a method renames that spy #950
Comments
I guess it's trying to be more helpful in other use cases. I agree that it looks weird when used the way you describe it here. Not sure whether this should be seen as a bug or if it's a feature with this behavior as a trade off. |
If that's the case, it doesn't go far enough since it only can be "renamed" this way once. And from a test-writer's perspective, it's very unhelpful if you are trying to sort out many similar spies which you have carefully given different names, but they are all getting renamed to a single property name because my code happens to store functions in wrapper objects and execute them as methods. If this is indeed a feature and not a bug, I think it should be deprecated. |
Would you be able to look at the Sinon sources and make a suggestion where to change it? I don't think anybody has "hard" dependencies on this, be it a bug or a feature - maybe there isn't even a specific intention behind it. |
I can certainly go digging… not this week, but sometime. |
I find this quite bizarre. Is this intended behavior? It really conflicts with clear test output. Executing a spy as a method of an object renames that spy to the method name, but only once:
The text was updated successfully, but these errors were encountered: