Tips &Tricks Blog

0

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

0

Cannot stub non-existent own property

The potential problem could be that sinon does not mock objects with dynamically-created methods through Object.prototype. To mitigate such problem, you can try the following : var sinon = require(‘sinon’); var sandbox = sinon.sandbox.create();...

0

How to cut and paste files in Mac

If you are windows user, you have probably been frustrated with the inability to do a cut paste in mac. Isint it supposed to be super obvious? Apparently not. Fortunately, it can still be...