Skip to content
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

Getters/setters don't work with spies #917

Closed
fearphage opened this issue Nov 9, 2015 · 0 comments · Fixed by gluckgames/pixi-packer#18
Closed

Getters/setters don't work with spies #917

fearphage opened this issue Nov 9, 2015 · 0 comments · Fixed by gluckgames/pixi-packer#18

Comments

@fearphage
Copy link
Member

Problem:

The following line throws, because sinon.wrapMethod gets passed the entire property descriptor ({get, set, enumerable, configurable}) and attempts to wrap every "method" (read: property) in the descriptor.

var spy = sinon.spy(object, "property", ["get"]);

The first one to throw is set which is undefined.

Side note: I don't see any documentation about getters/setters spies and stubs anywhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant