Skip to content

Commit

Permalink
Floor percentages (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
antonagestam authored Jun 11, 2021
1 parent 1ddac4c commit 7b96dd4
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ public
.dynamodb/

# Node modules
node_modules
node_modules
12 changes: 6 additions & 6 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16007,9 +16007,9 @@ function markdownReport(reports, commit, options) {
for (const file of report.files.filter(
(file) => filteredFiles == null || filteredFiles.includes(file.filename)
)) {
const fileTotal = Math.round(file.total);
const fileLines = Math.round(file.line);
const fileBranch = Math.round(file.branch);
const fileTotal = Math.floor(file.total);
const fileLines = Math.floor(file.line);
const fileBranch = Math.floor(file.branch);
const fileMissing =
showMissingMaxLength > 0
? crop(file.missing, showMissingMaxLength)
Expand All @@ -16035,9 +16035,9 @@ function markdownReport(reports, commit, options) {
_Minimum allowed coverage is `80%`_
*/

const total = Math.round(report.total);
const linesTotal = Math.round(report.line);
const branchTotal = Math.round(report.branch);
const total = Math.floor(report.total);
const linesTotal = Math.floor(report.line);
const branchTotal = Math.floor(report.branch);
const table = [
[
"File",
Expand Down
12 changes: 6 additions & 6 deletions src/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ function markdownReport(reports, commit, options) {
for (const file of report.files.filter(
(file) => filteredFiles == null || filteredFiles.includes(file.filename)
)) {
const fileTotal = Math.round(file.total);
const fileLines = Math.round(file.line);
const fileBranch = Math.round(file.branch);
const fileTotal = Math.floor(file.total);
const fileLines = Math.floor(file.line);
const fileBranch = Math.floor(file.branch);
const fileMissing =
showMissingMaxLength > 0
? crop(file.missing, showMissingMaxLength)
Expand All @@ -112,9 +112,9 @@ function markdownReport(reports, commit, options) {
_Minimum allowed coverage is `80%`_
*/

const total = Math.round(report.total);
const linesTotal = Math.round(report.line);
const branchTotal = Math.round(report.branch);
const total = Math.floor(report.total);
const linesTotal = Math.floor(report.line);
const branchTotal = Math.floor(report.branch);
const table = [
[
"File",
Expand Down
28 changes: 14 additions & 14 deletions src/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ test("markdownReport", () => {
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :white_check_mark: |
| **All files** | \`77%\` | :white_check_mark: |
| \\_\\_init\\_\\_.py | \`80%\` | :white_check_mark: |
| bar.py | \`75%\` | :white_check_mark: |
| foo.py | \`75%\` | :white_check_mark: |
Expand All @@ -230,7 +230,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
| \\_\\_init\\_\\_.py | \`80%\` | :x: |
| bar.py | \`75%\` | :x: |
| foo.py | \`75%\` | :x: |
Expand All @@ -248,7 +248,7 @@ _Minimum allowed coverage is \`100%\`_
| File | Coverage | Lines | |
| - | :-: | :-: | :-: |
| **All files** | \`78%\` | \`78%\` | :white_check_mark: |
| **All files** | \`77%\` | \`77%\` | :white_check_mark: |
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | :white_check_mark: |
| bar.py | \`75%\` | \`80%\` | :white_check_mark: |
| foo.py | \`75%\` | \`100%\` | :white_check_mark: |
Expand All @@ -266,7 +266,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | Branches | |
| - | :-: | :-: | :-: |
| **All files** | \`78%\` | \`0%\` | :white_check_mark: |
| **All files** | \`77%\` | \`0%\` | :white_check_mark: |
| \\_\\_init\\_\\_.py | \`80%\` | \`0%\` | :white_check_mark: |
| bar.py | \`75%\` | \`0%\` | :white_check_mark: |
| foo.py | \`75%\` | \`75%\` | :white_check_mark: |
Expand All @@ -285,7 +285,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | Lines | Branches | |
| - | :-: | :-: | :-: | :-: |
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: |
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: |
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: |
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: |
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: |
Expand All @@ -305,7 +305,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | Lines | Branches | | Missing |
| - | :-: | :-: | :-: | :-: | :-: |
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: | |
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: | |
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: | \`24-26\` |
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: | \`23-24, 39-40\` |
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: | |
Expand All @@ -326,7 +326,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | Lines | Branches | | Missing |
| - | :-: | :-: | :-: | :-: | :-: |
| **All files** | \`78%\` | \`78%\` | \`0%\` | :white_check_mark: | |
| **All files** | \`77%\` | \`77%\` | \`0%\` | :white_check_mark: | |
| \\_\\_init\\_\\_.py | \`80%\` | \`80%\` | \`0%\` | :white_check_mark: | \`24-26\` |
| bar.py | \`75%\` | \`80%\` | \`0%\` | :white_check_mark: | \`23-24...\` |
| foo.py | \`75%\` | \`100%\` | \`75%\` | :white_check_mark: | |
Expand All @@ -340,7 +340,7 @@ _Minimum allowed coverage is \`70%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
| \\_\\_init\\_\\_.py | \`80%\` | :white_check_mark: |
| bar.py | \`75%\` | :x: |
| foo.py | \`75%\` | :x: |
Expand All @@ -354,7 +354,7 @@ _Minimum allowed coverage is \`80%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
| ClassFoo | \`80%\` | :x: |
| ClassBar | \`75%\` | :x: |
| ClassMoo | \`75%\` | :x: |
Expand All @@ -368,7 +368,7 @@ _Minimum allowed coverage is \`100%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
| bar.py | \`75%\` | :x: |
_Minimum allowed coverage is \`100%\`_
Expand All @@ -381,7 +381,7 @@ _Minimum allowed coverage is \`100%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
_Minimum allowed coverage is \`100%\`_
Expand All @@ -392,7 +392,7 @@ _Minimum allowed coverage is \`100%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
_Minimum allowed coverage is \`100%\`_
Expand All @@ -417,13 +417,13 @@ _Minimum allowed coverage is \`100%\`_
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
<strong>${defaultReportName} bar.xml</strong>
| File | Coverage | |
| - | :-: | :-: |
| **All files** | \`78%\` | :x: |
| **All files** | \`77%\` | :x: |
_Minimum allowed coverage is \`100%\`_
Expand Down

0 comments on commit 7b96dd4

Please sign in to comment.