Configuring Jasmine
In order to configure Jasmine, the first step is to download the framework from https://github.com/pivotal/jasmine/tree/master/dist. In this download link, you will find the latest releases of the framework.
Note
At the time of writing this book, the latest release is v2.0 that we will use in this chapter.
After unpacking jasmine-standalone-2.0.0.zip
, you will find the following directories and files, as shown in the following screenshot:
The src
directory contains the JavaScript source files that you want to test. The spec
directory contains the JavaScript test files, while the SpecRunner.html
file is the test cases' runner HTML file. The lib
directory contains the framework files.
In order to make sure that everything is running okay, click on the SpecRunner.html
file; you should see specs passing, as shown in the following screenshot:
Note that this structure is not rigid; we can modify it to serve the organization...