Getting the application and tests ready to run

Now that we have the Chai assertion library API under our belts, it is time to write and organize the tests. While we have incidentally covered much of this material already, the concise core of a Mocha test infrastructure includes:

  • Test runner: Configures the overall test run and report
  • Test suites: One or more organization units grouping many specifications/tests
  • Setup/Teardown: Setting up a state for each test or suite run
  • Specifications: Writing the test functions

Starting at the highest level, we look at our test driver web page. As previously discussed, this is where our core application libraries, test libraries, and test specifications are set up and included. All of the Backbone.js application ...

Get Backbone.js Testing now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.