Skip to content

Commit dd23aab

Browse files
authored
Don't fail if no rows in traceability matrix (#75)
1 parent 40cb2f0 commit dd23aab

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

template.qmd

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,15 @@ if (require("covtracer", quietly = TRUE)) {
205205
dplyr::mutate(file = paste0("``` ", file, " ```")) %>%
206206
dplyr::select(`Test Description` = test_name, Documentation = file)
207207
208-
tt(
209-
tt_covtracer_df,
210-
caption = "Tracebility matrix mapping unit tests to documented behaviours.",
211-
theme = "striped"
212-
)
208+
if (nrow(tt_covtracer_df) > 0) {
209+
tt(
210+
tt_covtracer_df,
211+
caption = "Tracebility matrix mapping unit tests to documented behaviours.",
212+
theme = "striped"
213+
)
214+
} else {
215+
cat("No test suites.")
216+
}
213217
} else {
214218
cat("{covtracer} not available to produce a traceability matrix")
215219
}

0 commit comments

Comments
 (0)