Skip to content Skip to sidebar Skip to footer
Showing posts with the label 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?

Sinon Clock.tick Doesn't Advance Time For Settimeout

I am writing a test for an async function which performs a series of tasks and at one point waits f… Read more Sinon Clock.tick Doesn't Advance Time For Settimeout

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

Test Node-schedule With Sinon Faketimers

I want to test my scheduleJob from the node-schedule package. With sinon useFakeTimers() i can skip… Read more Test Node-schedule With Sinon Faketimers

Pulling In Sinon Submodules In Browser With Amd And Webpack

I'm running into the same problem described in this question. Basically sinon only pulls in all… Read more Pulling In Sinon Submodules In Browser With Amd And Webpack

How To Stub/mock Submodules Of A Require Of Nodejs Using Sinon

I am using sinon as for unit testing a nodejs(Hapijs) functionality. This function is in index.js. … Read more How To Stub/mock Submodules Of A Require Of Nodejs Using Sinon

Has Been Called With Object Assertion

Function I'm spying on, receives object as an argument. I need to assert that the function been… Read more Has Been Called With Object Assertion

Spying On Date Constructor With Sinon

I have a method that sets expiration date of a token: var jwt = require('jwt-simple'); modu… Read more Spying On Date Constructor With Sinon