npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

danger-plugin-coverage

v1.6.2

Published

A Danger plugin to report code coverage.

Downloads

13,726

Readme

danger-plugin-coverage

npm version semantic-release .github/workflows/deploy.yml

A Danger plugin to report code coverage.

This plugin detects and parses coverage reports, posting the results as a Markdown table back to the pull request.

It uses the clover.xml format, which is output by Istanbul, a coverage reporter integrated with JavaScript testing tools such as Jest and Karma.

This format can also be output by testing libraries for other languages, such as PHPUnit. So, while this is primarily intended as a tool to run against JavaScript packages it would technically work as a coverage reporter for other languages too.

Coverage Report

Test coverage is looking a little low for the files created or modified in this PR, perhaps we need to improve this.

Coverage threshold for branches (80%) not met: 49.08%
Coverage threshold for functions (80%) not met: 74.46%

|Impacted Files|% Stmts|% Branch|% Funcs|% Line|Uncovered Lines|| |---|:-:|:-:|:-:|:-:|:-:|:-:| |src/module-one.js|100|100|100|100||:white_check_mark:| |src/module-two.js|95.24|33.33|66.67|80|1, 42, 1337...|:x:| |src/module-three.js|82.33|10.25|44.55|45.55|12, 15, 32...|:x:| |src/module-four.js|100|0|10|32.5|54, 65, 94...|:x:| |src/module-five.js|100|100|100|100||:white_check_mark:|

|Impacted Files|% Stmts|% Branch|% Funcs|% Line|Uncovered Lines|| |---|:-:|:-:|:-:|:-:|:-:|:-:| |src/module-six.js|100|100|100|100||:white_check_mark:| |src/module-seven.js|100|100|100|100||:white_check_mark:|

Usage

Install:

yarn add danger-plugin-coverage --dev

At a glance:

// dangerfile.js
import coverage from 'danger-plugin-coverage';

schedule(coverage());

Note that the coverage report output by your test runner must exist before Danger is run. By default we will look for the report at coverage/clover.xml, which is the default output location for Jest.

Settings

The function accepts a settings object with the following properties:

| name | description | |----------------------|----------------------------------------------------------------------------------------------| | successMessage | A custom message to show when coverage is above the threshold. | | failureMessage | A custom message to show when coverage is below the threshold. | | cloverReportPath | Override automatic coverage report detection to provide the relative path to a report. | | maxRows | The number of rows to show (additional rows will be collapsed within a <details> element). | | maxChars | The maximum number of characters to allow in a file name cell. | | maxUncovered | The maximum number of uncovered lines to show. | | wrapFilenames | Wrap long file names to help the table fit in a PR comment. | | threshold | The thresholds at which to show the failure messaging. | | warnOnNoReport | Show a warning if no coverage report was detected. |

Example (defaults shown):

import coverage from 'danger-plugin-coverage';

schedule(coverage({
  successMessage: ':+1: Test coverage is looking good.',
  failureMessage: 'Test coverage is looking a little low for the files created '
    + 'or modified in this PR, perhaps we need to improve this.',
  cloverReportPath: './coverage/clover.xml',
  maxRows: 3,
  maxChars: 100,
  maxUncovered: 10,
  wrapFilenames: true,
  warnOnNoReport: true,
  showAllFiles: false,
  threshold: {
    statements: 80,
    branches: 80,
    functions: 80,
    lines: 80,
  },
}));