Sinon.js best practices for spies, stubs and mocks

Tags:

Sinon is one of the most important tools for testing, as without it writing tests for more complex pieces of code such as Ajax, networking, databases, etc. would become difficult.

In this article, I’ll show you the best practices for using Sinon, so you’ll be able to apply it to your own projects more easily.

  • What are the differences between spies, stubs and mocks?
  • When and how to use each of them for best results
  • Common pitfalls and how to avoid problems

Read the rest of this article