1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Remove invalid Jest storybook coverage config (#12846)

The Jest storybook config was mistakenly set to overwrite the coverage
report for our main set of Jest tests. It also had extremely high
coverage thresholds set, and the `collectCoverageFrom` config was
asking Jest to check that the storybook tests cover all of the UI code.

For now the `collectCoverageFrom` config has been removed. I don't
understand why we'd want to use Storybook to unit test in the first
place, so I don't understand what parts of the codebase we'd want to
cover with these tests. So for the moment, only the files touched by
the current tests are considered.

The coverage output directory is now set to `jest-coverage/storybook`
so that it does not overlap with any other coverage reports.
This commit is contained in:
Mark Stacey 2021-11-30 14:52:07 -03:30 committed by GitHub
parent b32bccc11e
commit d0c1fd713d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,17 +1,7 @@
/* eslint-disable import/unambiguous */
module.exports = {
collectCoverageFrom: ['<rootDir>/ui/**/*.js'],
coverageDirectory: './jest-coverage/main',
coveragePathIgnorePatterns: ['.stories.js', '.snap'],
coverageDirectory: './jest-coverage/storybook',
coverageReporters: ['json', 'lcov', 'text', 'clover'],
coverageThreshold: {
global: {
branches: 35,
functions: 37,
lines: 43,
statements: 43,
},
},
// TODO: enable resetMocks
// resetMocks: true,
restoreMocks: true,