Here's how to make a spy return a value in Sinon.js
Sinon Tutorials
Sinon's callsFake() function lets you configure what a stub function returns. Here's what you need to know.
Here's how mocks work in Sinon.js
Here's how spies work in Sinon.js
Here's how you can use Sinon to stub a function.
Here's two ways to check whether a SinonJS stub was called with given arguments.
Here's how you can use `sinon.stub()` to stub out functions and assert that they were called.