2.1.0 • Published 4 years ago

jest-coverage-processor v2.1.0

Weekly downloads
356
License
MIT
Repository
github
Last release
4 years ago

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, '    '
   });
};