Tagged: sinon.js

sinonjs 0

Attempted to wrap undefined property as function

The poten­tial prob­lem could be that your meth­ods are dynamically-created meth­ods through Object.prototype. If that’s the case then, you can try the fol­low­ing : sinon.stub(FUT.prototype, “Foo”).returns(true); FUT — Func­tion Under Test

sinonjs 0

Cannot stub non-existent own property

The poten­tial prob­lem could be that sinon does not mock objects with dynamically-created meth­ods through Object.prototype. To mit­i­gate such prob­lem, you can try the fol­low­ing : var sinon = require(‘sinon’); var sand­box = sinon.sandbox.create();…