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

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

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

How To Spy A Function With Sinon.js That Is In The Same Js File As The Function Under Test

I have a problem with Sinon.js while trying to spy a function that is in the same javascript file a… Read more How To Spy A Function With Sinon.js That Is In The Same Js File As The Function Under Test

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

Sinon.js Stub A Function That Resolves A Promise

I want to use Sinon to stub a function that uses callbacks which resolve a promise: const callback … Read more Sinon.js Stub A Function That Resolves A Promise

Stub Save Instance Method Of Mongoose Model With Sinon

I am trying to test a service function I use to save a widget using a Mongoose model. I want to stu… Read more Stub Save Instance Method Of Mongoose Model With Sinon