Getting started with Jasmine
1) Install
cmd > npm install -g jasmine
2) Check installation
cmd > jasmine -v
3) Create a directory, say 'jasminefromScratch' and open CLI in this directory
Initialize a project using command 'jasmine init'. It will create a spec directory and configuration json file
4) This is the configuration file
5) The directory will look like this
6) Create spec file with name myTestspec.js containing the following
7) cmd> navigate to the directory root folder and run command 'jasmine'
Which means, you have successfully run your setup and a spec test.
8) More than 1 specs.
9) The order of execution happens in alphabetic order.
cmd > npm install -g jasmine
2) Check installation
cmd > jasmine -v
3) Create a directory, say 'jasminefromScratch' and open CLI in this directory
Initialize a project using command 'jasmine init'. It will create a spec directory and configuration json file
4) This is the configuration file
jasmine.json |
6) Create spec file with name myTestspec.js containing the following
The spec filename should end with spec and .js extension |
Which means, you have successfully run your setup and a spec test.
8) More than 1 specs.
Number of dots (.) represent #of tests .i.e # of 'it' blocks |
Comments
Post a Comment