Update Jest coverage reporters (#12845)

The coverage reporter for the console has been changed from `text` to
`text-summary` because `text` was too long. It exceeded the maximum
length of the CircleCI terminal output shown on their jobs page, making
it very difficult to see why the unit test coverage job failed.

The text summary only displays overall coverage metrics, but that is
usually enough to indicate when the test fails due to a drop in
coverage. The more detailed breakdown is still available as a HTML
report linked in the `metamaskbot` comment, and in the `jest-coverage`
directory when run locally.

The three on-disk coverage reports used previously (`lcov`, `json`, and
`clover`) have been replaced with just `html`. The HTML report was part
of the `lcov` report, and it was the only one we were using.
feature/default_network_editable
Mark Stacey 3 years ago committed by GitHub
parent b6b202ca13
commit 267cdc4e6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      development/jest.config.js
  2. 2
      jest.config.js
  3. 2
      jest.stories.config.js

@ -2,7 +2,7 @@ module.exports = {
displayName: '/development', displayName: '/development',
collectCoverageFrom: ['<rootDir>/**/*.js'], collectCoverageFrom: ['<rootDir>/**/*.js'],
coverageDirectory: '../jest-coverage/development/', coverageDirectory: '../jest-coverage/development/',
coverageReporters: ['json', 'lcov', 'text', 'clover'], coverageReporters: ['html', 'text-summary'],
coverageThreshold: { coverageThreshold: {
'./development/build/transforms/**/*.js': { './development/build/transforms/**/*.js': {
branches: 100, branches: 100,

@ -2,7 +2,7 @@ module.exports = {
collectCoverageFrom: ['<rootDir>/ui/**/*.js', '<rootDir>/shared/**/*.js'], collectCoverageFrom: ['<rootDir>/ui/**/*.js', '<rootDir>/shared/**/*.js'],
coverageDirectory: './jest-coverage/main', coverageDirectory: './jest-coverage/main',
coveragePathIgnorePatterns: ['.stories.js', '.snap'], coveragePathIgnorePatterns: ['.stories.js', '.snap'],
coverageReporters: ['json', 'lcov', 'text', 'clover'], coverageReporters: ['html', 'text-summary'],
coverageThreshold: { coverageThreshold: {
global: { global: {
branches: 35, branches: 35,

@ -1,7 +1,7 @@
/* eslint-disable import/unambiguous */ /* eslint-disable import/unambiguous */
module.exports = { module.exports = {
coverageDirectory: './jest-coverage/storybook', coverageDirectory: './jest-coverage/storybook',
coverageReporters: ['json', 'lcov', 'text', 'clover'], coverageReporters: ['html', 'text-summary'],
// TODO: enable resetMocks // TODO: enable resetMocks
// resetMocks: true, // resetMocks: true,
restoreMocks: true, restoreMocks: true,

Loading…
Cancel
Save