-
-
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
Stub get does not work with sandbox stub #1401
Comments
I have the same problem, wanted to switch to using the sandbox and expected stubs to work the same but there is no get function on the sandbox. Is there another method to accomplish the same functionality? |
@lukiano I did some digging through the code and you can stub out properties, just with a different syntax. Quite confusing and would be nice if this was consistent. |
@lucasfcosta, do you remember why we chose not to align these two APIs? There was something ... but the details elude me. |
Hi @fatso83, that's because we discussed that through DM's on Twitter. I also explain why we can't do this on this post. Basically, this issue is a duplicate of #781. Since we've had many changes in the codebase since then, these are my new thoughts on how we could solve this. Since a sandbox extends a This also means we can now have a uniform API and add Also, by looking at the If you all agree on this I can refactor |
@lucasfcosta, I think that makes plenty of sense. If you have the time, then please! |
@fatso83, for sure! I'll love to work on this refactor and a few other related improvements while eating some sushi this weekend 😄 |
stub().get()
used to stub property getters, works well withsinon.stub
, but I get get is not a function withsandbox.stub
.Also, slightly related,
.get
does not exist on the typescript definition @types/sinonThe text was updated successfully, but these errors were encountered: