We will use the NPM tool to install Jasmine. Open your favorite Terminal and execute the following command:
$ npm install jasmine --global
The preceding instruction will install Jasmine as an executable program that you can invoke in any folder in your Terminal. We achieve this using the --global flag in the npm install command.
Once Jasmine is installed, we need to create our project example skeleton to practice with Jasmine. For this, we need to do the following:
- Create a new folder called practice-jasmine
- Initialize a new Jasmine project by executing the jasmine init command
- Write our test script
So, having the steps clear, open your Terminal and execute the following commands:
$ mkdir practice-jasmine ...