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

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

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

Stub A Standalone Module.exports Function Using Rewire

I am trying to stub a module.exports function. But I have some trouble. I will give you a sudo code… Read more Stub A Standalone Module.exports Function Using Rewire

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

Simple Way To Test Middleware In Express Without Creating Recreating Server?

I'd like to be able to stub my middleware functions on a per-test basis. The problem, as articu… Read more Simple Way To Test Middleware In Express Without Creating Recreating Server?

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