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 🙏

© 2026 – Pkg Stats / Ryan Hefner

test-verdict

v0.6.0

Published

Universal test & code coverage PR decorator and merge gate supporting JaCoCo, Cobertura, LCOV, Istanbul/Jest, Go, and OpenCover.

Readme

Test Verdict

Universal test & code coverage PR decorator and merge gate - available as a GitHub Action, an Azure Pipelines task, and a standalone CLI tool.

test-verdict auto-detects and aggregates coverage reports across many languages, evaluates test coverage thresholds, comments on your PR and can enforce merge gates, blocking PRs until coverage thresholds are met. Use it directly in GitHub Actions workflows, in Azure Pipelines via the native TestVerdict task, or standalone via npx test-verdict.

CI Docs npm license

Interactive setup and configuration guide: steveswinsburg.github.io/test-verdict.

Features

  • Format-agnostic auto-detection - parses and merges multiple reports across languages in a single pass.
  • Overall & PR diff coverage - gates both total coverage and changed lines in the pull request.
  • Sticky PR comment & Job Step Summary - updates a single PR comment in place, with a full breakdown in the workflow summary.
  • Branch-protection ready - fails the check on threshold breaches when enforce: true so PRs cannot merge until passing.
  • Fork-PR safe - gracefully degrades to Job Step Summary + exit-code gating if Github token permissions don't allow commenting.
  • Azure Pipelines task - native TestVerdict extension task with sticky Azure DevOps PR comments, Build Summary upload, and output variables.
  • Standalone CLI tool - zero-dependency CLI you can run locally, in pre-push hooks, or in any CI provider via npx test-verdict.

Example PR Comment

Test Verdict - ✅ Passed

| Suite | Lines | Branches | Functions | PR Diff | Status | | :--- | ---: | ---: | ---: | ---: | :---: | | Overall | 91.1% (1552/1703) | 70.4% (386/548) | 96.2% (75/78) | 94.4% (34/36) | ✅ Pass |

By default, GitHub attributes PR comments posted with GITHUB_TOKEN to github-actions Bot. See CUSTOM_BOT.md if you want comments posted under a custom bot name and avatar (such as test-verdict Bot).

Supported Formats

| Format | Ecosystems / Tools | | :--- | :--- | | LCOV (.info) | JS/TS (Vitest, Jest, c8, Istanbul), Rust (llvm-cov, tarpaulin), Flutter/Dart, C/C++, Ruby, PHP | | Cobertura XML | Python (pytest-cov, coverage.py), .NET (coverlet), Go (gocover-cobertura), Ruby, PHP | | JaCoCo XML | Java, Kotlin, Scala, Groovy (Maven & Gradle) | | Istanbul / Jest JSON | JS/TS (coverage-final.json, coverage-summary.json) | | Go coverprofile | Go (go test -coverprofile=coverage.out) | | OpenCover XML | .NET (OpenCover, AltCover) |

See EXAMPLES.md for full recipes covering every report format, GitHub Actions, Azure Pipelines, parameter combinations, and standalone CLI usage.

Quickstart

GitHub Actions

name: Coverage Gate

on:
  pull_request:

permissions:
  contents: read
  pull-requests: write

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - run: npm test -- --coverage

      - uses: steveswinsburg/test-verdict@v0
        with:
          files: |
            **/jacocoTestReport.xml
            coverage/lcov.info
            coverage.xml
          min-line: 80
          min-diff-line: 90

Enforcing Merge Gates

Set enforce: true (the default) and mark the workflow job as a required status check in your repository's Branch Protection / Rulesets. Any threshold violation fails the check and blocks the PR merge.

Azure Pipelines

trigger:
  - main

pr:
  - main

pool:
  vmImage: ubuntu-latest

steps:
  - checkout: self
    fetchDepth: 0

  # Run your test & coverage command (e.g. ./gradlew test jacocoTestReport, dotnet test, or npm test -- --coverage)

  - task: TestVerdict@0
    inputs:
      files: |
        **/jacocoTestReport.xml
        coverage/lcov.info
        TestResults/**/coverage.cobertura.xml
      minLine: '80'
      minDiffLine: '90'

See AZURE_PIPELINES.md for Java, .NET, and Node.js quickstarts, task inputs, output variables, Build Service permissions, and Branch Policy setup, or EXAMPLES.md for the full set of Azure Pipelines recipes.

Standalone CLI

npx test-verdict \
  --files coverage/lcov.info \
  --files "**/jacocoTestReport.xml" \
  --min-line 80 \
  --min-diff-line 90 \
  --diff-base origin/main

See Standalone CLI below for installation and all CLI flags, or EXAMPLES.md for format-specific commands.

Security Hardening

For locked-down organization or reusable workflows:

  • Isolate pull-requests: write and avoid persisted credentials: Put pull-requests: write only on a separate publish job that downloads the coverage artifact, so npm ci / yarn install lifecycle scripts, lint, and tests only hold contents: read. Also pass persist-credentials: false to actions/checkout so git credentials are not left on disk. LCOV, Istanbul, and Cobertura work in the publish job without a checkout, whereas JaCoCo package-path resolution benefits from a persist-credentials: false checkout.
  • Guard against missing reports after early failures: Add if: ${{ !cancelled() && hashFiles('coverage/lcov.info') != '' }} when running Test Verdict after test or build steps that might fail before writing a report, so CI does not add a second noisy red step.
  • Ignore repo-committed config: Pass config: none so a pull request cannot commit .test-verdict.yml to exclude files or override workflow thresholds.
  • Count brand-new untested files in PR diff: Pass include: globs (for example src/**/*.ts) and/or enable coverage.all: true in your test runner so newly added files absent from the report count as 0% diff coverage instead of 0/0.
  • Pin by commit SHA: Pin steveswinsburg/test-verdict@<full-commit-sha> in high-security pipelines.

Monorepo Coverage Groups

Create an optional .test-verdict.yml at the repository root to evaluate multiple suites or packages with independent thresholds in one step:

title: Monorepo Coverage
exclude:
  - "**/*.generated.*"
  - "**/__tests__/**"
thresholds:
  min-line: 80
  min-diff-line: 85
groups:
  - name: backend-java
    files:
      - "services/api/**/jacocoTestReport.xml"
    thresholds:
      min-line: 85
      min-branch: 75
  - name: frontend-web
    files:
      - "apps/web/coverage/lcov.info"
    thresholds:
      min-line: 80

Action Inputs

| Input | Default | Description | | :--- | :--- | :--- | | files | - | Newline or comma-separated coverage report globs | | format | auto | auto | lcov | cobertura | jacoco | istanbul | gocover | opencover | | config | .test-verdict.yml | Path to optional YAML config file, or none / false to disable | | include | - | Newline or comma-separated source path inclusion globs (missing diff files count as 0%) | | exclude | - | Newline or comma-separated source path exclusion globs | | report-id | default | Identifier for sticky PR comments across multiple steps | | title | Test Verdict | Heading for PR comments and step summaries | | min-line | - | Minimum overall line coverage % (0–100) | | min-branch | - | Minimum overall branch coverage % (0–100) | | min-function | - | Minimum overall function coverage % (0–100) | | min-diff-line | - | Minimum PR changed-lines coverage % (0–100) | | min-diff-branch | - | Minimum PR changed-lines branch coverage % (0–100) | | enforce | true | Fail the check when thresholds are breached | | fail-on-empty | true | Fail if no coverage files match or parsed reports contain no measured files | | comment | true | Post or update sticky PR comment | | step-summary | true | Write Job Step Summary | | github-token | ${{ github.token }} | Token used for PR diff and comments | | working-directory | . | Working directory |

Action Outputs

| Output | Description | | :--- | :--- | | line-coverage | Overall line coverage percentage | | branch-coverage | Overall branch coverage percentage | | function-coverage | Overall function coverage percentage | | diff-coverage | PR diff line coverage percentage | | passed | "true" or "false" | | summary-json | JSON payload summarizing all groups, metrics, violations, and warnings |

Standalone CLI

Global install:

npm install -g test-verdict

Or run without installing via npx:

npx test-verdict --files coverage/lcov.info --min-line 80
npx test-verdict --files coverage/lcov.info --min-line 80 --diff-base origin/main --markdown

| Option | Description | | :--- | :--- | | -f, --files <glob> | Coverage report glob pattern (repeatable) | | --format <fmt> | auto | lcov | cobertura | jacoco | istanbul | gocover | opencover | | -c, --config <path> | Path to .test-verdict.yml (or none / false to disable) | | --no-config | Disable auto-loading .test-verdict.yml | | --include <glob> | Source file glob to include (repeatable; missing diff files count as 0%) | | -e, --exclude <glob> | Source file glob to exclude (repeatable) | | --report-id <id> | Sticky comment report ID (default: "default") | | --title <text> | Report title (default: "Test Verdict") | | --min-line <pct> | Minimum overall line coverage % (0–100) | | --min-branch <pct> | Minimum overall branch coverage % (0–100) | | --min-function <pct> | Minimum overall function coverage % (0–100) | | --min-diff-line <pct> | Minimum PR/git diff line coverage % (0–100) | | --min-diff-branch <pct> | Minimum PR/git diff branch coverage % (0–100) | | --diff-base <ref> | Git ref to diff against (e.g. origin/main, HEAD~1) | | --working-dir <dir> | Working directory (default: .) | | --enforce / --no-enforce | Exit non-zero on threshold breach (default: true) | | --fail-on-empty / --no-fail-on-empty | Fail when no reports match or contain no measured files (default: true) | | --markdown | Print Markdown report to stdout | | --json | Print JSON summary to stdout | | -h, --help | Show help message | | -v, --version | Show version |

Development

npm ci
npm run typecheck
npm run test:coverage
npm run build
npm run package:azure   # package Azure Pipelines .vsix into dist/

Releasing a New Version

npm version patch --no-git-tag-version   # or minor / major
npm run build
git add package.json package-lock.json dist/ azure-pipelines/vss-extension.json azure-pipelines/task/task.json
git commit -m "chore: release v$(node -p "require('./package.json').version")"
git push origin main

On push to main:

  • .github/workflows/ci.yml runs typecheck, tests, coverage, dist/ + Azure extension manifest verification, and dogfoods Test Verdict (both the GitHub Action and standalone CLI).
  • .github/workflows/release.yml automatically:
    1. Publishes the new version to npmjs via Trusted Publishing (OIDC) if not already published.
    2. Creates the v<version> GitHub Release with auto-generated release notes.
    3. Updates the floating major tag (e.g. v0 for v0.x.x, v1 for v1.x.x) for GitHub Action consumers.
    4. Packages the Azure Pipelines .vsix and attaches it to the GitHub Release for manual upload to the Visual Studio Marketplace.

To list a release on GitHub Actions Marketplace, edit the created GitHub Release and check Publish this Action to the GitHub Marketplace.

Contributing a New Format Parser

  1. Implement CoverageParser in src/parsers/<format>.ts (id, canParse(filePath, snippet), parse(content, sourceFile)).
  2. Register the parser in createDefaultParserRegistry() inside src/parsers/registry.ts.
  3. Add realistic fixture files under tests/fixtures/ and unit tests under tests/parsers/.

Made with ❤️ for better code everywhere.