Socket
Socket
Sign inDemoInstall

testaged-coverage

Package Overview
Dependencies
487
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    testaged-coverage

Utility script to run tests and verify coverage threshold for stages files


Version published
Weekly downloads
69
decreased by-24.18%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

testaged-coverage


Use this library to execute tests on your git staged files and verify they comply with the test coverage threshold.

Before the tests are run, make sure you have set a Jest "coverageThreshold". You can learn how to configure it here.

{
  ...
  "jest": {
    "coverageThreshold": {
      "global": {
        "branches": 80,
        "functions": 80,
        "lines": 80,
        "statements": -10
      }
    }
  }
}

How to use it

You need to stage your files first with gir add.

In a pre-commit hook

You will need to have husky installed. In your package.json, add the script to run as a pre-commit hook.

// package.json
{
  "husky": {
    "hooks": {
      "pre-commit": "node ./node_modules/testaged-coverage && <you can include other scripts here (e.g. lint-staged)>"
    }
  },
}

Directly in command line

Just execute node ./node_modules/testaged-coverage

Keywords

FAQs

Last updated on 20 Apr 2020

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