Carl-Erik Kopseng
Carl-Erik Kopseng
OK, I have verified this using the example you posted. This does indeed look like a bug. Not sure why we treat a `class` object differently than a normal `Object`,...
Function does not work either, as expected: ```js const sinon = require('sinon') const sandbox = sinon.createSandbox() function MyTest() {} MyTest.test = function (value) { return value } sandbox.stub(MyTest) sandbox.restore() sandbox.stub(MyTest)...
this was not so straight forward after all ... we have different paths for objects and functions, so it got a bit hairy when I was looking at it. I'll...
@ghdoergeloh [That same page](https://sinonjs.org/releases/latest/utils/) documents exactly that method (second from the top), and it is both part of the exposed public API of the `sinon` export and [listed on the...
I suspected as much after reading it myself, but feel free to improve it to make it less ambiguous: https://github.com/sinonjs/sinon/blob/master/docs/release-source/release/utils.md
Hi, @marceliwac. Thanks for bumping this. I have forgotten all about it to be honest. When I looked at it now, I just saw the last part of the conversation,...
@marceliwac There are two sides to your issue 1. Why the error happens 2. If this should be handled or not # The why When one does `sinon.spy(myFunc)` this is...
I don't see why we should restrict ourselves to classes, per se. I think such a feature should work on any function as well, not just the subset that are...
Well, that does not really change anything about the feature disparity (being able to `sinon.stub()` things on the prototype) and how things work (throws or not). The stubs/spies interface would...
OK, with that in mind, then `sinon.define` rocks 🚀