MochaJS + PhantomJS + LCOV (node/grunt/blanket)
- Install Node.js (binary) [http://nodejs.org]
- Install Phantom.js (binary) [http://phantomjs.org]
- Run
npm install mocha-phantomjs --save-dev
github[https://www.npmjs.org/package/mocha-phantomjs] - Run
npm install mocha --save-dev
github[https://github.com/mochajs/mocha] - Run
npm install chai --save-dev
[http://chaijs.com/guide/installation/] - Install sonar reoprter: Run
npm install xunit-file --save-dev
github [https://github.com/peerigon/xunit-file] - All JS tests are: /spec/*.js
- All Sonar Coverage Xml reports are: /reports/*.xml
- Run tests from cli:
mocha-phantomjs -R spec TestRunner.html
- Export tests to reports folder:
mocha-phantomjs -R xunit TestRunner.html > reports/mocha-test.xml
- Export MPS example TEST to XML:
mocha-phantomjs -R xunit appendTestRunner.html > reports/append-test.xml