Skip to content

Commit 9a4ab37

Browse files
punxaphiltm1000
andauthored
Make it possible to skip package coverage (#97)
Co-authored-by: Andrew Nagy <[email protected]>
1 parent d4adc7c commit 9a4ab37

11 files changed

+163
-131
lines changed

__tests__/__snapshots__/functions.test.ts.snap

+18-9
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ exports[`Dont Fail on negative difference if negative_difference_threshold is se
3030
| utils.ts | 🟠 70.94% | 🟠 69% | 🔴 -1.94% |
3131
| **Overall Coverage** | **🟢 50.51%** | **🟢 49%** | **🔴 -1.51%** |
3232
33-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`"
33+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`
34+
"
3435
`;
3536

3637
exports[`Fail if negative_difference_threshold is set and exceeded 1`] = `
@@ -64,7 +65,8 @@ exports[`Fail if negative_difference_threshold is set and exceeded 2`] = `
6465
| utils.ts | 🟠 70.94% | 🟠 69% | 🔴 -1.94% |
6566
| **Overall Coverage** | **🟢 50.51%** | **🟢 49%** | **🔴 -1.51%** |
6667
67-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`"
68+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`
69+
"
6870
`;
6971

7072
exports[`Fail if overall coverage is below fail threshold 1`] = `
@@ -98,7 +100,8 @@ exports[`Fail if overall coverage is below fail threshold 2`] = `
98100
| utils.ts | 🟠 70.94% | 🟠 70.94% | ⚪ 0% |
99101
| **Overall Coverage** | **🔴 50.51%** | **🔴 50.51%** | **⚪ 0%** |
100102
101-
_Minimum allowed coverage is_ \`99%\`_, this run produced_ \`50.51%\`"
103+
_Minimum allowed coverage is_ \`99%\`_, this run produced_ \`50.51%\`
104+
"
102105
`;
103106

104107
exports[`Fail on negative difference 1`] = `
@@ -132,7 +135,8 @@ exports[`Fail on negative difference 2`] = `
132135
| utils.ts | 🟠 70.94% | 🟠 69% | 🔴 -1.94% |
133136
| **Overall Coverage** | **🟢 50.51%** | **🟢 49%** | **🔴 -1.51%** |
134137
135-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`"
138+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`
139+
"
136140
`;
137141

138142
exports[`Generate Base Clover Markdown 1`] = `
@@ -165,7 +169,8 @@ exports[`Generate Base Clover Markdown 2`] = `
165169
| utils.ts | 🟠 70.94% |
166170
| **Overall Coverage** | **🟢 50.51%** |
167171
168-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`50.51%\`"
172+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`50.51%\`
173+
"
169174
`;
170175

171176
exports[`Generate Base Cobertura Markdown 1`] = `
@@ -198,7 +203,8 @@ exports[`Generate Base Cobertura Markdown 2`] = `
198203
| utils.ts | 🟠 67.36% |
199204
| **Overall Coverage** | **🟢 49.83%** |
200205
201-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49.83%\`"
206+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49.83%\`
207+
"
202208
`;
203209

204210
exports[`Generate Diffed Clover Markdown 1`] = `
@@ -231,7 +237,8 @@ exports[`Generate Diffed Clover Markdown 2`] = `
231237
| utils.ts | 🟠 70.94% | 🟠 70.94% | ⚪ 0% |
232238
| **Overall Coverage** | **🟢 50.51%** | **🟢 50.51%** | **⚪ 0%** |
233239
234-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`50.51%\`"
240+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`50.51%\`
241+
"
235242
`;
236243

237244
exports[`Generate Diffed Cobertura Markdown 1`] = `
@@ -264,7 +271,8 @@ exports[`Generate Diffed Cobertura Markdown 2`] = `
264271
| utils.ts | 🟠 67.36% | 🟠 67.36% | ⚪ 0% |
265272
| **Overall Coverage** | **🟢 49.83%** | **🟢 49.83%** | **⚪ 0%** |
266273
267-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49.83%\`"
274+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49.83%\`
275+
"
268276
`;
269277

270278
exports[`Only list changed files 1`] = `
@@ -290,5 +298,6 @@ exports[`Only list changed files 2`] = `
290298
| utils.ts | 🟠 70.94% | 🟠 69% | 🔴 -1.94% |
291299
| **Overall Coverage** | **🟢 50.51%** | **🟢 49%** | **🔴 -1.51%** |
292300
293-
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`"
301+
_Minimum allowed coverage is_ \`0%\`_, this run produced_ \`49%\`
302+
"
294303
`;

__tests__/utils.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ test('getInputs', () => {
147147
negativeDifferenceBy: 'package',
148148
negativeDifferenceThreshold: -0,
149149
retention: undefined,
150+
skipPackageCoverage: false,
150151
onlyListChangedFiles: false,
151152
//This is a cheat
152153
withBaseCoverageTemplate: f.withBaseCoverageTemplate,

dist/index.js

+49-44
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/with-base-coverage.hbs

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/without-base-coverage.hbs

+3-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)