In order to configure Jasmine, the first step is to download the framework from https://github.com/pivotal/jasmine/downloads. Here, you will find the latest releases of the framework. At the time of this writing, the latest release is v1.2.0, which has been used in this book.
After unpacking jasmine-standalone-1.2.0.zip
(or later), you will find the folder structure shown in the following screenshot:
The src
folder in the preceding screenshot contains the JavaScript source files that you want to test, the spec
folder contains the JavaScript testing files, while SpecRunner.html
is the test case runner HTML file. The lib
folder contains the framework files.
In order to make sure that everything is running OK, click on the SpecRunner.html
file; you should see passing specs, as shown in the following screenshot:
This structure is not rigid; you can modify it to serve the organization of your application. For the purpose of testing the weather application, we will modify it to cope...