Skip to content Skip to sidebar Skip to footer
Showing posts with the label Sinon

Sinon - Stubbing Function With Callback - Causing Test Method To Timeout

I have a method on a express route that looks like this: exports.register_post = function(req, res)… Read more Sinon - Stubbing Function With Callback - Causing Test Method To Timeout

Sinon Spy Function Called But Not Tracked

I am using Mocha and sinon to spy on a function call. The function is called correctly but the spy … Read more Sinon Spy Function Called But Not Tracked

Using Sinon Mocks With Nodeunit

I'm learning to use sinon with nodeunit, specifically to do mocking. The recommended approach … Read more Using Sinon Mocks With Nodeunit

Stubbing Window.location.href With Sinon

I am trying to test some client-side code and for that I need to stub the value of window.location.… Read more Stubbing Window.location.href With Sinon

How Do I Stub A Chain Of Methods In Sinon?

I know how to use stub to replace one function. sandbox.stub(Cars, 'findOne', (… Read more How Do I Stub A Chain Of Methods In Sinon?

Test Simple Logger Functions With Full Code Coverage

I'm using Chai, Sinon and Instanbul to test a NodeJS application. Here's the Logger code: i… Read more Test Simple Logger Functions With Full Code Coverage