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

jasmine.json






5) The directory will look like this
6) Create spec file with name myTestspec.js containing the following
The spec filename should end with spec and .js extension
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.

Number of dots (.) represent #of tests .i.e # of 'it' blocks


 9) The order of execution happens in alphabetic order.

Comments

Popular Posts