Puppeteer to Istanbul
Convert coverage from the format outputted by puppeteer to a format consumable by Istanbulistanbul.
To Output Coverage in Istanbul Format with Puppeteer
- install puppeteer,
npm i -D puppeteer.
- install puppeteer-to-istanbul,
npm i -D puppeteer-to-istanbul.
- run your code in puppeteer with coverage enabled:
To Check Istanbul Reports
- install nyc,
npm i nyc -g.
- use nyc's report functionality:
puppeteer-to-istanbul outputs temporary files in a format that can be consumed by nyc.
```bash nyc report --reporter=html ```
see istanbul for a list of possible reporters.
ContributingThe best way to get started with Puppeteer to Istanbul is by installing it for yourself and running tests. PTI requires the most recent build of v8toistanbul to function properly, so start by running
Next, ensure that all tests are passing before continuing by running
npm test(or equivalently,
npm t). This should generate a report that gives the same coverage as seen on this README.
Note that a majority of the tests run against pre-generated fixtures, or JSON snippets, that come from Puppeteer's raw output. These are located in the
\test\fixturesarea. To generate one of your own, write or use one of the scripts in the test area
test\sample_js, and run
bin/puppeteer-js-runner.jsthrough node, like so:
node bin/puppeteer-js-runner.js --file=/test/sample_js/sample2.js.
If you see an issue with Puppeteer to Istanbul, please open an issue! If you want to help improve Puppeteer to Istanbul, please fork the repository and open a pull request with your changes.
Make sure to review our contributing guidecontributing for specific guidelines on contributing.