Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

coverage-svg

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coverage-svg

coverage % tag as svg generated for istambul unit test coverage provider

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

coverage-svg reporter for istambul provider

Coverage % tag as svg generated for istambul unit test coverage provider.

git GitHub NPM version coverage

This reporter generates the coverage.svg file in directories next to index.html with least % from

  • Statement
  • Branch
  • Functions
  • Lines

vitest config sample

export default {
    test: {
        coverage: {
            reporter: ['text', 'json', 'html','coverage-svg'],
            provider: 'istanbul'
        }
    }
}

Use in README.md

The SVG should be available either in the repo or on CDN in order to be shown in GitHub page.

As unpkg.com reflects the npm content, where the coverage usually is not included, it can be done by publishing either test project with coverage results or the coverage content alone.

The good example would be a test project for custom-element.

coverage explainer

Often there is a need to generate the coverage not only for essential sources but also for complimentary code like mocks, StoryBook, etc. That impacts the total stats and do not have the interest to the consumer. The coverage-svg generates the SVG on each module and folder which you can refer individually. In this case the coverage for test-proj/coverage/src/package2 is published on

https://unpkg.com/coverage-svg@0.0.3 and the generated image is

https://unpkg.com/coverage-svg@0.0.3/test-proj/coverage/src/package2/coverage.svg

change on release/ npm publish

The unpkg.com keeps each version of released package. You would need to update the URLs before release.

Keywords

FAQs

Package last updated on 12 May 2024

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