Attempted to wrap undefined property as function

The poten­tial prob­lem could be that your methods are dynamically-created meth­ods through Object.prototype.

If that’s the case then, you can try the following :

sinon.stub(FUT.prototype, "Foo").returns(true);

FUT - Function Under Test

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *