To use Mocha, you will first need to download the mocha.css
and mocha.js
files from the project's GitHub page (which can be found at https://github.com/mochajs/mocha). You will also need to download an assertion library; for this example, we'll be using Expect.js
(which you can download from https://github.com/Automattic/expect.js).
Next, you will need to create a new HTML page and add script tags for all of your application's JavaScript files, as well as all library files (for instance, Backbone and jQuery). You'll also need to add a few bits of Mocha boilerplate code. All together you should wind up with an HTML file that looks something like the following:
<html> <head> <!-- External Library Files --> <script src="/underscore.js"></script> <script src="/jQuery.js"></script> <script src="/Backbone.js"></script> <!-- Application-Specific Files --> <script src="/SomeModel.js"></script> <script...