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:

Configuring Jasmine

Jasmine Standalone 2.0 directories and files

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:

Configuring Jasmine

Jasmine specs passing

Note that this structure is not rigid; we can modify it to serve the organization of our app, as we will see in the Jasmine in action – developing Cordova app tests section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.158.165