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

How To Unit Test A Function Which Calls Another That Returns A Promise?

I have a node.js app using express 4 and this is my controller: var service = require('./catego… Read more How To Unit Test A Function Which Calls Another That Returns A Promise?

Sinon - How To Stub Authentication Library (authy -twilio)

I am currently new to Sinon, Mocha, Supertest and in the process to writes tests. In my current sce… Read more Sinon - How To Stub Authentication Library (authy -twilio)

Sinon Stub With Es6-promisified Object

Ok my setup is as follows: Using node 6.2, es6-promisify, sinon, sinon-as-promised, and babel to tr… Read more Sinon Stub With Es6-promisified Object

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

How Does One Stub Promise With Sinon?

I have a data service with following function function getInsureds(searchCriteria) { var defer… Read more How Does One Stub Promise With Sinon?

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?