New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

puppeteer-to-istanbul

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

puppeteer-to-istanbul

convert from puppeteer's coverage output to a format that can be used by istanbul reports

  • 1.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by4.02%
Maintainers
1
Weekly downloads
 
Created
Source

Puppeteer to Istanbul

Build Status Coverage Status Standard Version

Convert coverage from the format outputted by puppeteer to a format consumable by Istanbul.

Usage

To Output Coverage in Istanbul Format with Puppeteer

  1. install puppeteer, npm i puppeteer --save.

  2. install puppeteer-to-istanbul, npm i puppeteer-to-istanbul --save.

  3. run your code in puppeteer with coverage enabled:

    (async () => {
      const pti = require('puppeteer-to-istanbul')
      const puppeteer = require('puppeteer')
      const browser = await puppeteer.launch()
      const page = await browser.newPage()
    
      // Enable both JavaScript and CSS coverage
      await Promise.all([
        page.coverage.startJSCoverage(),
        page.coverage.startCSSCoverage()
      ]);
      // Navigate to page
      await page.goto('https://www.google.com');
      // Disable both JavaScript and CSS coverage
      const [jsCoverage, cssCoverage] = await Promise.all([
        page.coverage.stopJSCoverage(),
        page.coverage.stopCSSCoverage(),
      ]);
      pti.write(jsCoverage)
      await browser.close()
    })()
    

To Run Istanbul Reports

  1. install nyc, npm i nyc -g.

  2. use nyc's report functionality:

    nyc report --reporter=html
    

puppeteer-to-istanbul outputs temporary files in a format that can be consumed by nyc.

see istanbul for a list of possible reporters.

Contributing

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 guide for specific guidelines on contributing.

Keywords

FAQs

Package last updated on 03 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc