Describe the bug
To Reproduce
Steps to reproduce the behavior:
This code will throw an exception TypeError: Cannot read property 'apply' of undefined due to the fake returned from withArgs not having a wrappedMethod member.
let stub = sinon.stub(obj, 'method')
.withArgs(123)
.returns('bar')
.callThrough();
obj.method('bar')
Expected behavior
The callThrough behavior should be available on withArgs fakes.
Screenshots
If applicable, add screenshots to help explain your problem.
Context (please complete the following information):
6.3.4 and master at 97a12178Additional context
I've prepared a test case demonstrating the issue:
https://github.com/sinonjs/sinon/compare/master...mgabeler-lee-6rs:issue-1964
That's a nice test ✨
Would you like to contribute a PR to fix it?
I had started looking into that at first, but didn't understand sinon's internals well enough to do so. If I have time to figure that out, I'd happily do so, but TBH I don't see that happening in the next couple weeks, so if someone else wants to go for it in the meantime, that's fine with me. If not, I'll try to revisit this when I have time :)
Had some time to dig into this finally today, filed #2012 with a proposed fix
Very nice work :heart: