Book Image

Backbone.js Testing

By : Ryan Glenn Roemer
Book Image

Backbone.js Testing

By: Ryan Glenn Roemer

Overview of this book

Table of Contents (13 chapters)
Backbone.js Testing
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Test Assertions, Specs, and Suites

With a Backbone.js application integrated into our budding test infrastructure and a rough test plan underway, we will now begin expanding our application's test coverage. In this chapter, we will introduce some fundamental testing tools and test more parts of the Backbone.js application in the following topics:

  • Surveying the Mocha and Chai test library interfaces and styles

  • Introducing the Chai assertion library API

  • Configuring the Mocha runner and the Backbone.js application for tests

  • Aggregating Mocha specifications into test suites and preparing test state

  • Writing test specifications in Mocha, beginning with Backbone.js collection specs

  • Testing asynchronous application code

  • Writing specs and HTML test fixtures for Backbone.js views

  • Dealing with software/test development pitfalls and learning how to write testable code