jest-coverage-processor

2.1.0 • Public • Published

jest-coverage-processor

Utils for working with Jest coverage data (auto update thresholds, etc.)

Installation

npm i jest-coverage-processor --save-dev

updateThresholds

  • Update your Jest config:
// jest.config.js
module.exports = {
  // ...
  testResultsProcessor: '<rootDir>/test-results-processor.js'
};
  • Add a test processor script:
// <rootDir>/test-results-processor.js
const path = require('path');
const {updateThresholds} = require('jest-coverage-processor');
 
module.exports = function (results) {
   return updateThresholds(results, {
       configPath: path.resolve(__dirname, './jest.config.js'),
       outputSpaces: '  ' // optional, default: 4 spaces, '    '
   });
};

Package Sidebar

Install

npm i jest-coverage-processor

Weekly Downloads

66

Version

2.1.0

License

MIT

Unpacked Size

5.84 kB

Total Files

5

Last publish

Collaborators

  • degiro