Socket
Socket
Sign inDemoInstall

jest-ratchet

Package Overview
Dependencies
5
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-ratchet

Ratchet up code coverage - keep test coverage going only one direction -- up


Version published
Weekly downloads
3.6K
decreased by-18.24%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Jest-Ratchet

Maintainability Build Status Coverage Status Known Vulnerabilities Greenkeeper badge

Ratchet up code coverage - keep test coverage going only one direction -- up

Jest-Ratchet is a coverage watcher for Jest. Everytime a new level of coverage is reached Jest-Ratchet will automatically update the coverageThreshold.

Installation

npm

npm install jest-ratchet --dev

yarn

yarn add jest-ratchet --dev

Jest Settings

Add jest-ratchet to the reporters section. And also ensure that collectCoverage is enabled and json-summary is added to the coverageReporters.

{
  "collectCoverage": true,
  "coverageReporters": ["json", "lcov", "text", "clover", "json-summary"],
  "reporters": ["default", "jest-ratchet"]
}

Optional Settings

By default, Jest-Ratchet is aggressive with updating coverage thresholds. Every time your coverage ticks up by 0.01%, the coverageThreshold is updated. There are a couple of options dampen this behavior.

  • tolerance (number): keeps the threshold below the measured coverage, allowing wiggle room. default: 0 tolerance
  • roundDown (boolean): round down to the nearest integer. default: false
  • timeout (number): the number of milliseconds to wait for to the Jest coverage json summary. default: wait indefinitely

Here's how to pass configuration to Jest-Ratchet, per the Jest documentation

{
  "collectCoverage": true,
  "coverageReporters": ["json", "lcov", "text", "clover", "json-summary"],
  "reporters": [
    "default",
    [
      "jest-ratchet",
      { "tolerance": 2, "roundDown": true, "timeout": 5000 }
    ]
  ]
}

Keywords

FAQs

Last updated on 14 Jun 2019

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc