Skip to content

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

License

Notifications You must be signed in to change notification settings

degiro/jest-coverage-processor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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