Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove summary title too if the table is empty. #8

Merged
merged 1 commit into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions dist/main.js
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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,
)
: "",
)
}