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

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)

Stubbing Redis Interactions In Javascript Using Sinon

I am working in node.js. My app interacts with Redis via the node_redis module. I'm using moch… Read more Stubbing Redis Interactions In Javascript Using 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

How Do I Access This Javascript Property?

I need to make sure that a certain method inside the below shown UserMock-class was called. I'v… Read more How Do I Access This Javascript Property?

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

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 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?