You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "implementation detail" behind this is, that withArgs and returns returns a "behavior" and not the stub instance. The behaviors can be chained. In your first snippet, you assign a behavior instance to myStub.
I can see that this is not really intuitive, but it's not a bug. Maybe it could be clarified in the docs.
Sinon.js (v1.14.1) has a weird behaviour in method chaining, not sure it's meant to be or a bug:
This (JSBin):
Will always return "two" no matter what argument you call
myStub
with.On the other hand, this (JSBin):
works fine. I'm not sure that SinonJS supports chaining or not.
Thanks, guys.
The text was updated successfully, but these errors were encountered: