Skip to content

Commit e43b024

Browse files
committed
coverage?
1 parent ba9ac39 commit e43b024

File tree

4 files changed

+19
-22
lines changed

4 files changed

+19
-22
lines changed

e2e/__tests__/__snapshots__/coverage_report.test.js.snap

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ exports[`outputs coverage report 1`] = `
7272
"-------------------------------------|----------|----------|----------|----------|-------------------|
7373
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
7474
-------------------------------------|----------|----------|----------|----------|-------------------|
75-
All files | 56.52 | 0 | 50 | 55.56 | |
76-
coverage-report | 41.18 | 0 | 25 | 42.86 | |
75+
All files | 59.09 | 0 | 50 | 58.82 | |
76+
coverage-report | 43.75 | 0 | 25 | 46.15 | |
7777
OtherFile.js | 100 | 100 | 100 | 100 | |
7878
Sum.js | 85.71 | 100 | 50 | 100 | |
7979
SumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 |
80-
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 |
80+
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 15,16,17,19 |
8181
coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | |
8282
Identical.js | 100 | 100 | 100 | 100 | |
8383
coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | |
@@ -88,20 +88,20 @@ All files | 56.52 | 0 | 50 | 55.56
8888
exports[`outputs coverage report when text and text-summary is requested 1`] = `
8989
"
9090
=============================== Coverage summary ===============================
91-
Statements : 56.52% ( 13/23 )
91+
Statements : 59.09% ( 13/22 )
9292
Branches : 0% ( 0/4 )
9393
Functions : 50% ( 3/6 )
94-
Lines : 55.56% ( 10/18 )
94+
Lines : 58.82% ( 10/17 )
9595
================================================================================
9696
-------------------------------------|----------|----------|----------|----------|-------------------|
9797
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
9898
-------------------------------------|----------|----------|----------|----------|-------------------|
99-
All files | 56.52 | 0 | 50 | 55.56 | |
100-
coverage-report | 41.18 | 0 | 25 | 42.86 | |
99+
All files | 59.09 | 0 | 50 | 58.82 | |
100+
coverage-report | 43.75 | 0 | 25 | 46.15 | |
101101
OtherFile.js | 100 | 100 | 100 | 100 | |
102102
Sum.js | 85.71 | 100 | 50 | 100 | |
103103
SumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 |
104-
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 |
104+
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 15,16,17,19 |
105105
coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | |
106106
Identical.js | 100 | 100 | 100 | 100 | |
107107
coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | |
@@ -113,12 +113,12 @@ exports[`outputs coverage report when text is requested 1`] = `
113113
"-------------------------------------|----------|----------|----------|----------|-------------------|
114114
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
115115
-------------------------------------|----------|----------|----------|----------|-------------------|
116-
All files | 56.52 | 0 | 50 | 55.56 | |
117-
coverage-report | 41.18 | 0 | 25 | 42.86 | |
116+
All files | 59.09 | 0 | 50 | 58.82 | |
117+
coverage-report | 43.75 | 0 | 25 | 46.15 | |
118118
OtherFile.js | 100 | 100 | 100 | 100 | |
119119
Sum.js | 85.71 | 100 | 50 | 100 | |
120120
SumDependency.js | 0 | 0 | 0 | 0 | 8,10,12 |
121-
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 8,15,16,17,19 |
121+
notRequiredInTestSuite.js | 0 | 0 | 0 | 0 | 15,16,17,19 |
122122
coverage-report/cached-duplicates/a | 100 | 100 | 100 | 100 | |
123123
Identical.js | 100 | 100 | 100 | 100 | |
124124
coverage-report/cached-duplicates/b | 100 | 100 | 100 | 100 | |
@@ -129,9 +129,9 @@ All files | 56.52 | 0 | 50 | 55.56
129129
exports[`outputs coverage report when text-summary is requested 1`] = `
130130
"
131131
=============================== Coverage summary ===============================
132-
Statements : 56.52% ( 13/23 )
132+
Statements : 59.09% ( 13/22 )
133133
Branches : 0% ( 0/4 )
134134
Functions : 50% ( 3/6 )
135-
Lines : 55.56% ( 10/18 )
135+
Lines : 58.82% ( 10/17 )
136136
================================================================================"
137137
`;

e2e/__tests__/coverage_report.test.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ test('outputs coverage report', () => {
1919
const {stdout, status} = runJest(DIR, ['--no-cache', '--coverage'], {
2020
stripAnsi: true,
2121
});
22-
const coverageDir = path.resolve(__dirname, '../coverage-report/coverage');
22+
const coverageDir = path.join(DIR, 'coverage');
2323

2424
// - the `setup.js` file is ignored and should not be in the coverage report.
2525
// - `SumDependency.js` is mocked and the real module is never required but
@@ -99,14 +99,7 @@ test('outputs coverage report as json', () => {
9999
{stripAnsi: true},
100100
);
101101
expect(status).toBe(0);
102-
103-
try {
104-
JSON.parse(stdout);
105-
} catch (err) {
106-
throw new Error(
107-
"Can't parse the JSON result from stdout. " + err.toString(),
108-
);
109-
}
102+
expect(() => JSON.parse(stdout)).not.toThrow();
110103
});
111104

112105
test('outputs coverage report when text is requested', () => {

e2e/coverage-report/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@babel/preset-flow'],
3+
};

e2e/coverage-report/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"collectCoverageFrom": [
44
"**/*.js",
55
"!setup.js",
6+
"!babel.config.js",
67
"!**/node_modules/**",
78
"!**/coverage/**"
89
],

0 commit comments

Comments
 (0)