0.0.5 • Published 1 year ago

jest-coverage-gate v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Jest Coverage Gate

npm

Checking the coverage of changed and added files

Features

  • Separate coverage threshold settings for new and changed files
  • Ability to specify target branch relative to which diff will be calculated

Usage

  1. Install:
npm i jest-coverage-gate -D
  1. Add jest-coverage-gate to the coverageReporters list of your Jest configuration:
{
  coverageReporters: [
    "clover", "json", "lcov", "text", // default
    [
      'jest-coverage-gate',
      {
        since: 'develop', // origin/develop, OR origin/develop...HEAD, OR commitHash...commitHash
        modified: {
          branches: 50,
          functions: 50,
          lines: 50,
          statements: 50,
        },
        added: {
          branches: 80,
          functions: 80,
          lines: 80,
          statements: 80,
        },
      },
    ],
  ],
}
  1. Run Jest:
jest --coverage
0.0.5

1 year ago

0.0.4

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago