Bye-Bye, Sinon – Hello, testdouble

UPDATE: Justin Searls, the author of testdouble.js sent me an email with some notes on this post. I’ve added some his comments below to provide some additional context. I’ve been working in JavaScript-land for the last little while, writing lots of Node.js code. Since I practice TDD, I’m always trying to keep my eye on […]

Working with Custom Return Values in GoogleMock

When working with the GoogleMock C++ mocking library, you can get pretty far using only default expectation return values or explicitly specifying expectation return values. There are some additional options that can save you a lot of effort in some circumstances though. Let’s take a look at a few of them. Standard Values Consider an […]

Mocking Objects with Sinon JS

We recently started writing a mobile website using JavaScript as our framework. To test the JavaScript framework we decided to try Sinon and Jasmine . With Sinon a mock is created from an instance of an object. Needing to create an instance of a class to make a mock becomes difficult for classes that have […]