Tag: testing


Chaining Sinon Mocks

Update Sinon actually already has a nice API for doing this out of the box without any prototype mucking: /** * test.mpsec.js */ var sinon = require('sinon'); var expect = require('chai').expect; var rewire = require('rewire'); var main = rewire('main'); var CoolModuleMock = { start: sinon.stub().returnsThis(

Continue Reading