Quite a few Backbone.js contributors feel that QUnit is a better introductory framework for testing if you don’t wish to start off with Jasmine and BDD right away. As we’ll see later on in this chapter, QUnit can also be combined with third-party solutions such as SinonJS to produce an even more powerful testing solution supporting spies and mocks, which some say is preferable over Jasmine.
My personal recommendation is that it’s worth comparing both frameworks and opting for the solution that you feel the most comfortable with.
Luckily, getting QUnit set up is a fairly straightforward process that will take less than five minutes.
We first set up a testing environment composed of three files:
An HTML structure for displaying test results
The qunit.js file composing the testing framework
The qunit.css file for styling test results
The latter two of these can be downloaded from the QUnit website.
If you would prefer, you can use a hosted version of the QUnit source files for testing purposes. The hosted URLs can be found at https://github.com/jquery/qunit/ ...