O'Reilly logo

Backbone.js Testing by Ryan Roemer

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Test Spies

As we begin looking at the more complicated parts of our Backbone.js application, the process of isolating dependencies and testable behaviors can become an increasingly daunting task. To provide a little help in these areas, we will introduce Sinon.JS, which is a powerful test mock, stub, and spy library, in this chapter.

Sinon.JS allows us to artificially isolate Backbone.js components and test specific behaviors without interacting with the rest of the application. We will kick off our discussion on Sinon.JS with the following topics:

  • Identifying some of the test limitations typically found in Backbone.js applications and testing scenarios that can benefit from test fakes
  • Introducing the Sinon.JS test double and assertion ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required