From 267cdc4e6b9d7ab1f47f51bb66addebf6c11e8a3 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Wed, 1 Dec 2021 15:16:34 -0330 Subject: [PATCH] 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. --- development/jest.config.js | 2 +- jest.config.js | 2 +- jest.stories.config.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/development/jest.config.js b/development/jest.config.js index 4eeaa048c..e4218c21f 100644 --- a/development/jest.config.js +++ b/development/jest.config.js @@ -2,7 +2,7 @@ module.exports = { displayName: '/development', collectCoverageFrom: ['/**/*.js'], coverageDirectory: '../jest-coverage/development/', - coverageReporters: ['json', 'lcov', 'text', 'clover'], + coverageReporters: ['html', 'text-summary'], coverageThreshold: { './development/build/transforms/**/*.js': { branches: 100, diff --git a/jest.config.js b/jest.config.js index 3ca5957ee..186afbfe9 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,7 +2,7 @@ module.exports = { collectCoverageFrom: ['/ui/**/*.js', '/shared/**/*.js'], coverageDirectory: './jest-coverage/main', coveragePathIgnorePatterns: ['.stories.js', '.snap'], - coverageReporters: ['json', 'lcov', 'text', 'clover'], + coverageReporters: ['html', 'text-summary'], coverageThreshold: { global: { branches: 35, diff --git a/jest.stories.config.js b/jest.stories.config.js index f0e6155fe..fa66332a3 100644 --- a/jest.stories.config.js +++ b/jest.stories.config.js @@ -1,7 +1,7 @@ /* eslint-disable import/unambiguous */ module.exports = { coverageDirectory: './jest-coverage/storybook', - coverageReporters: ['json', 'lcov', 'text', 'clover'], + coverageReporters: ['html', 'text-summary'], // TODO: enable resetMocks // resetMocks: true, restoreMocks: true,