2014年6月30日 星期一

Karma Coverage 環境建置 - Linux

Karma-Jasmine 2.0
For get below reports:
  • Karma coverage report
  • Jasmine HTML report (debug)
  • Jasmine junit report (Jenkins)
1. Install nodejs & npm

$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs
$ sudo apt-get install npm

2. Install Karma relatives packages (for Jasmine 2.0)

$ sudo npm install -g karma
$ sudo npm install -g karma-phantomjs-launcher --save-dev
$ sudo npm install -g karma-jasmine@2_0 --save-dev
$ sudo npm install -g karma-coverage --save-dev
$ sudo npm install -g karma-html-reporter --save-dev
$ sudo npm install -g karma-junit-reporter --save-dev

3. Try it

$ karma

Build the link if NOT work

$ sudo ln -s /usr/lib/node_modules/karma/bin/karma /usr/local/bin/

沒有留言:

張貼留言