Skip to content

Commit

Permalink
Merge pull request romeovs#8 from andybelltree/add-skip-empty-post-op…
Browse files Browse the repository at this point in the history
…tion

Remove summary title too if the table is empty.
  • Loading branch information
andybelltree committed Aug 29, 2022
2 parents 6ae0eb6 + 978c69a commit 53cb1e0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
8 changes: 4 additions & 4 deletions dist/main.js
Expand Up @@ -22986,14 +22986,14 @@ function comment(lcov, options) {
: `Coverage for this commit`,
table(tbody(tr(th(percentage(lcov).toFixed(2), "%")))),
"\n\n",
details(
reportTable ? details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
),
) : '',
)
}

Expand Down Expand Up @@ -23029,14 +23029,14 @@ function diff(lcov, before, options) {
),
),
"\n\n",
details(
reportTable ? details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
),
) : '',
)
}

Expand Down
36 changes: 20 additions & 16 deletions src/comment.js
Expand Up @@ -17,14 +17,16 @@ export function comment(lcov, options) {
: `Coverage for this commit`,
table(tbody(tr(th(percentage(lcov).toFixed(2), "%")))),
"\n\n",
details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
),
reportTable
? details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
)
: "",
)
}

Expand Down Expand Up @@ -60,13 +62,15 @@ export function diff(lcov, before, options) {
),
),
"\n\n",
details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
),
reportTable
? details(
summary(
options.shouldFilterChangedFiles
? "Coverage Report for Changed Files"
: "Coverage Report",
),
reportTable,
)
: "",
)
}

0 comments on commit 53cb1e0

Please sign in to comment.