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

mo3ta-coverage

v1.0.9

Published

Run tests and report uncovered changed lines in a PR

Readme

mo3ta-coverage

mo3ta-coverage is a CLI tool for checking test coverage of changed lines in a pull request. It runs related tests, parses coverage reports, and ensures cumulative coverage meets a specified threshold—ideal for CI and code review workflows.

Features

  • Detects changed files between branches using git diff
  • Runs related Jest tests for changed files
  • Parses lcov.info for coverage data
  • Reports uncovered changed lines
  • Optionally displays covered changed lines
  • Checks overall coverage against a user-defined limit

Usage

mo3ta-coverage --base origin/master --lcov coverage/lcov.info --limit 80 --showCovered --shallowTests=false

CLI Options

| Option | Description | Default | |------------------|------------------------------------------------------------------|----------------------| | --base | Base branch to compare against | origin/main | | --lcov | Path to lcov.info file generated by test coverage tools | coverage/lcov.info | | --limit | Minimum required coverage percentage for all changed lines | 80 | | --showCovered | Show covered changed lines in the output | false | | --shallowTests | Run test files only, skipping other files | true |

How It Works

  1. Parse CLI options using commander in index.js.
  2. Get changed files: Uses git diff --name-only <base> to find modified JS/TS files (src/cli.js).
  3. Run related tests: Executes Jest for changed files with --findRelatedTests (src/cli.js).
  4. Parse coverage: Reads lcov.info to find uncovered lines (src/cli.js).
  5. Report: Prints uncovered changed lines, optionally covered lines, and overall coverage (src/cli.js).
  6. Enforce limit: Exits with error if coverage is below the specified threshold.

mo3ta-coverage

Run tests and report uncovered changed lines in a PR. Checks cumulative coverage for all changed lines against a specified limit. Useful for CI and code review workflows.

Installation

npm install -g mo3ta-coverage

Usage

mo3ta-coverage --base origin/main --lcov coverage/lcov.info --limit 80 --showCovered --shallowTests

Options

  • --base <branch>: Base branch to compare against (default: origin/main or config value)
  • --lcov <path>: Path to lcov.info file generated by test coverage tools (default: coverage/lcov.info)
  • --limit <percent>: Minimum required coverage percentage for all changed lines (default: 80)
  • --showCovered: Show covered changed lines in the output
  • --shallowTests: Run test files only without deep in tests tree

Configuration

You can persist default options using the config command:

mo3ta-coverage config --base origin/dev --shallowTests false

This will save your preferences in .mo3ta-coverage.json in your project root. The CLI will use these values unless overridden by command-line options.

Development

  1. Clone the repository
  2. Install dependencies:
    npm install
  3. Run tests:
    npm test
  4. Run tests with coverage:
    npm run test:coverage

License

MIT