Sinon.JS

Standalone test spies, stubs and mocks for JavaScript. No dependencies, works with any unit testing framework.