Skip to content

Commit 19f8e4c

Browse files
committed
Add coverage
1 parent c816abd commit 19f8e4c

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

.codecov.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
codecov:
2+
require_ci_to_pass: yes
3+
4+
coverage:
5+
precision: 2
6+
round: down
7+
range: '10...100'
8+
9+
status:
10+
project: yes
11+
patch: yes
12+
changes: no
13+
14+
parsers:
15+
gcov:
16+
branch_detection:
17+
conditional: yes
18+
loop: yes
19+
method: no
20+
macro: no
21+
22+
comment:
23+
layout: 'reach,diff,flags,tree'
24+
behavior: default
25+
require_changes: no

jest.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,17 @@ module.exports = {
1212
// cacheDirectory: "/var/folders/xp/bp966jvd70j25zc1cz6sd905psfs4r/T/jest_ueoec8",
1313

1414
// Automatically clear mock calls and instances between every test
15-
clearMocks: true,
15+
clearMocks: false,
1616

1717
// Indicates whether the coverage information should be collected while executing the test
18-
collectCoverage: false,
18+
collectCoverage: true,
1919

2020
// An array of glob patterns indicating a set of files for which coverage information should be collected
21-
// collectCoverageFrom: null,
21+
collectCoverageFrom: [
22+
'<rootDir>/src/**/*{js,ts,jsx,tsx}',
23+
'!<rootDir>/src/**/*stories',
24+
'!**/node_modules/**',
25+
],
2226

2327
// The directory where Jest should output its coverage files
2428
coverageDirectory: 'coverage',
@@ -27,7 +31,7 @@ module.exports = {
2731
coveragePathIgnorePatterns: ['/node_modules/', 'stories'],
2832

2933
// A list of reporter names that Jest uses when writing coverage reports
30-
coverageReporters: ['json', 'text', 'lcov', 'clover'],
34+
coverageReporters: ['lcov', 'clover', 'text', 'text-summary'],
3135

3236
// An object that configures minimum threshold enforcement for coverage results
3337
// coverageThreshold: null,

0 commit comments

Comments
 (0)