Client-side JS code coverage using PhantomJS, Mocha and Blanket
npm install ponchoClient-side JS code coverage using PhantomJS, Mocha and Blanket.
``sh`
$ npm i --save-dev poncho
`
Usage: poncho [options]
Options:
-h, --help output usage information
-V, --version output the version number
-R, --reporter [type] reporter: plain (default) | lcov | json
`
Let's imagine that you already have PhantomJS + Mocha client-side tests (with mocha-phantomjs, for example), something like this test/test.html:
`html
`
All you need to do is add data-cover attribute to the target script tag:
`html`
…and run Poncho:
`sh`
$ poncho --reporter num test/test.html
Install node-coveralls:
`sh`
$ npm i --save-dev coverallslcov
…and pipe Poncho's reporter to it:
`sh``
$ poncho --reporter lcov test/test.html | coveralls
You don't want to know. Seriosly. It's so hacky way that it can cause the blood from your eyes.