Skip to content

Commit 7b96dd4

Browse files
authored
Floor percentages (#44)
1 parent 1ddac4c commit 7b96dd4

File tree

4 files changed

+27
-27
lines changed

4 files changed

+27
-27
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,4 @@ public
9797
.dynamodb/
9898

9999
# Node modules
100-
node_modules
100+
node_modules

dist/index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -16007,9 +16007,9 @@ function markdownReport(reports, commit, options) {
1600716007
for (const file of report.files.filter(
1600816008
(file) => filteredFiles == null || filteredFiles.includes(file.filename)
1600916009
)) {
16010-
const fileTotal = Math.round(file.total);
16011-
const fileLines = Math.round(file.line);
16012-
const fileBranch = Math.round(file.branch);
16010+
const fileTotal = Math.floor(file.total);
16011+
const fileLines = Math.floor(file.line);
16012+
const fileBranch = Math.floor(file.branch);
1601316013
const fileMissing =
1601416014
showMissingMaxLength > 0
1601516015
? crop(file.missing, showMissingMaxLength)
@@ -16035,9 +16035,9 @@ function markdownReport(reports, commit, options) {
1603516035
_Minimum allowed coverage is `80%`_
1603616036
*/
1603716037

16038-
const total = Math.round(report.total);
16039-
const linesTotal = Math.round(report.line);
16040-
const branchTotal = Math.round(report.branch);
16038+
const total = Math.floor(report.total);
16039+
const linesTotal = Math.floor(report.line);
16040+
const branchTotal = Math.floor(report.branch);
1604116041
const table = [
1604216042
[
1604316043
"File",

src/action.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ function markdownReport(reports, commit, options) {
8484
for (const file of report.files.filter(
8585
(file) => filteredFiles == null || filteredFiles.includes(file.filename)
8686
)) {
87-
const fileTotal = Math.round(file.total);
88-
const fileLines = Math.round(file.line);
89-
const fileBranch = Math.round(file.branch);
87+
const fileTotal = Math.floor(file.total);
88+
const fileLines = Math.floor(file.line);
89+
const fileBranch = Math.floor(file.branch);
9090
const fileMissing =
9191
showMissingMaxLength > 0
9292
? crop(file.missing, showMissingMaxLength)
@@ -112,9 +112,9 @@ function markdownReport(reports, commit, options) {
112112
_Minimum allowed coverage is `80%`_
113113
*/
114114

115-
const total = Math.round(report.total);
116-
const linesTotal = Math.round(report.line);
117-
const branchTotal = Math.round(report.branch);
115+
const total = Math.floor(report.total);
116+
const linesTotal = Math.floor(report.line);
117+
const branchTotal = Math.floor(report.branch);
118118
const table = [
119119
[
120120
"File",

src/action.test.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ test("markdownReport", () => {
216216
217217
| File | Coverage | |
218218
| - | :-: | :-: |
219-
| **All files** | \`78%\` | :white_check_mark: |
219+
| **All files** | \`77%\` | :white_check_mark: |
220220
| \\_\\_init\\_\\_.py | \`80%\` | :white_check_mark: |
221221
| bar.py | \`75%\` | :white_check_mark: |
222222
| foo.py | \`75%\` | :white_check_mark: |
@@ -230,7 +230,7 @@ _Minimum allowed coverage is \`70%\`_
230230
231231
| File | Coverage | |
232232
| - | :-: | :-: |
233-
| **All files** | \`78%\` | :x: |
233+
| **All files** | \`77%\` | :x: |
234234
| \\_\\_init\\_\\_.py | \`80%\` | :x: |
235235
| bar.py | \`75%\` | :x: |
236236
| foo.py | \`75%\` | :x: |
@@ -248,7 +248,7 @@ _Minimum allowed coverage is \`100%\`_
248248
249249
| File | Coverage | Lines | |
250250
| - | :-: | :-: | :-: |
251-
| **All files** | \`78%\` | \`78%\` | :white_check_mark: |
251+
| **All files** | \`77%\` | \`77%\` | :white_check_mark: |
252252
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | :white_check_mark: |
253253
| bar.py | \`75%\` | \`80%\` | :white_check_mark: |
254254
| foo.py | \`75%\` | \`100%\` | :white_check_mark: |
@@ -266,7 +266,7 @@ _Minimum allowed coverage is \`70%\`_
266266
267267
| File | Coverage | Branches | |
268268
| - | :-: | :-: | :-: |
269-
| **All files** | \`78%\` | \`0%\` | :white_check_mark: |
269+
| **All files** | \`77%\` | \`0%\` | :white_check_mark: |
270270
| \\_\\_init\\_\\_.py | \`80%\` | \`0%\` | :white_check_mark: |
271271
| bar.py | \`75%\` | \`0%\` | :white_check_mark: |
272272
| foo.py | \`75%\` | \`75%\` | :white_check_mark: |
@@ -285,7 +285,7 @@ _Minimum allowed coverage is \`70%\`_
285285
286286
| File | Coverage | Lines | Branches | |
287287
| - | :-: | :-: | :-: | :-: |
288-
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: |
288+
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: |
289289
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: |
290290
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: |
291291
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: |
@@ -305,7 +305,7 @@ _Minimum allowed coverage is \`70%\`_
305305
306306
| File | Coverage | Lines | Branches | | Missing |
307307
| - | :-: | :-: | :-: | :-: | :-: |
308-
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: | |
308+
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: | |
309309
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: | \`24-26\` |
310310
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: | \`23-24, 39-40\` |
311311
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: | |
@@ -326,7 +326,7 @@ _Minimum allowed coverage is \`70%\`_
326326
327327
| File | Coverage | Lines | Branches | | Missing |
328328
| - | :-: | :-: | :-: | :-: | :-: |
329-
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: | |
329+
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: | |
330330
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: | \`24-26\` |
331331
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: | \`23-24...\` |
332332
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: | |
@@ -340,7 +340,7 @@ _Minimum allowed coverage is \`70%\`_
340340
341341
| File | Coverage | |
342342
| - | :-: | :-: |
343-
| **All files** | \`78%\` | :x: |
343+
| **All files** | \`77%\` | :x: |
344344
| \\_\\_init\\_\\_.py | \`80%\` | :white_check_mark: |
345345
| bar.py | \`75%\` | :x: |
346346
| foo.py | \`75%\` | :x: |
@@ -354,7 +354,7 @@ _Minimum allowed coverage is \`80%\`_
354354
355355
| File | Coverage | |
356356
| - | :-: | :-: |
357-
| **All files** | \`78%\` | :x: |
357+
| **All files** | \`77%\` | :x: |
358358
| ClassFoo | \`80%\` | :x: |
359359
| ClassBar | \`75%\` | :x: |
360360
| ClassMoo | \`75%\` | :x: |
@@ -368,7 +368,7 @@ _Minimum allowed coverage is \`100%\`_
368368
369369
| File | Coverage | |
370370
| - | :-: | :-: |
371-
| **All files** | \`78%\` | :x: |
371+
| **All files** | \`77%\` | :x: |
372372
| bar.py | \`75%\` | :x: |
373373
374374
_Minimum allowed coverage is \`100%\`_
@@ -381,7 +381,7 @@ _Minimum allowed coverage is \`100%\`_
381381
382382
| File | Coverage | |
383383
| - | :-: | :-: |
384-
| **All files** | \`78%\` | :x: |
384+
| **All files** | \`77%\` | :x: |
385385
386386
_Minimum allowed coverage is \`100%\`_
387387
@@ -392,7 +392,7 @@ _Minimum allowed coverage is \`100%\`_
392392
393393
| File | Coverage | |
394394
| - | :-: | :-: |
395-
| **All files** | \`78%\` | :x: |
395+
| **All files** | \`77%\` | :x: |
396396
397397
_Minimum allowed coverage is \`100%\`_
398398
@@ -417,13 +417,13 @@ _Minimum allowed coverage is \`100%\`_
417417
418418
| File | Coverage | |
419419
| - | :-: | :-: |
420-
| **All files** | \`78%\` | :x: |
420+
| **All files** | \`77%\` | :x: |
421421
422422
<strong>${defaultReportName} bar.xml</strong>
423423
424424
| File | Coverage | |
425425
| - | :-: | :-: |
426-
| **All files** | \`78%\` | :x: |
426+
| **All files** | \`77%\` | :x: |
427427
428428
_Minimum allowed coverage is \`100%\`_
429429

0 commit comments

Comments
 (0)