From dd23aabe32c6e2499db71001b2e2313198c11ac4 Mon Sep 17 00:00:00 2001 From: walkowif <59475134+walkowif@users.noreply.github.com> Date: Mon, 3 Jun 2024 12:43:09 +0200 Subject: [PATCH] Don't fail if no rows in traceability matrix (#75) --- template.qmd | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/template.qmd b/template.qmd index d796b8f..7ed4257 100644 --- a/template.qmd +++ b/template.qmd @@ -205,11 +205,15 @@ if (require("covtracer", quietly = TRUE)) { dplyr::mutate(file = paste0("``` ", file, " ```")) %>% dplyr::select(`Test Description` = test_name, Documentation = file) - tt( - tt_covtracer_df, - caption = "Tracebility matrix mapping unit tests to documented behaviours.", - theme = "striped" - ) + if (nrow(tt_covtracer_df) > 0) { + tt( + tt_covtracer_df, + caption = "Tracebility matrix mapping unit tests to documented behaviours.", + theme = "striped" + ) + } else { + cat("No test suites.") + } } else { cat("{covtracer} not available to produce a traceability matrix") }