From 6f96ad2857a23574dd453087f7a6a732d2a73316 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 11 Dec 2025 14:53:38 +0100 Subject: [PATCH 1/2] Test are "fixed" to pass --- tests/testthat/_snaps/card.md | 6 +++--- tests/testthat/_snaps/render_table.md | 2 +- tests/testthat/test-utils.R | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/testthat/_snaps/card.md b/tests/testthat/_snaps/card.md index dc83597..ab4e274 100644 --- a/tests/testthat/_snaps/card.md +++ b/tests/testthat/_snaps/card.md @@ -1,4 +1,4 @@ -# Card is created with the expected components depending on arguments: only has title if no other argument is set +# Card is created with the expected components depending on arguments / only has title if no other argument is set Code create_info_card("test title") @@ -7,7 +7,7 @@

test title

-# Card is created with the expected components depending on arguments: has title and header +# Card is created with the expected components depending on arguments / has title and header Code create_info_card(title = "test title", header = "Information header") @@ -17,7 +17,7 @@

test title

-# Card is created with the expected components depending on arguments: has all arguments set +# Card is created with the expected components depending on arguments / has all arguments set Code create_info_card(title = "test title", header = "Information header", text = "Extra test") diff --git a/tests/testthat/_snaps/render_table.md b/tests/testthat/_snaps/render_table.md index 85ef369..5712ff7 100644 --- a/tests/testthat/_snaps/render_table.md +++ b/tests/testthat/_snaps/render_table.md @@ -1,4 +1,4 @@ -# Namespace table is created: It is created by without error from existing example package assessment +# Namespace table is created / It is created by without error from existing example package assessment Code prepare_namespace_table(example_assessment) diff --git a/tests/testthat/test-utils.R b/tests/testthat/test-utils.R index 1120812..90e5ba7 100644 --- a/tests/testthat/test-utils.R +++ b/tests/testthat/test-utils.R @@ -6,7 +6,7 @@ test_that("include_exclude_from works", { }) test_that("All riskmetric:::pkg_ref_class_hierarchy have value to display in our report", { - allowed_names <- unlist(riskmetric:::pkg_ref_class_hierarchy) + allowed_names <- unlist(riskmetric::pkg_ref_class_hierarchy) expect_true(all(!is.na(sapply(allowed_names, get_pkg_origin)))) }) From be6dd88d7a0acccb4c964a4c92e944cf747e6d52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Revilla?= Date: Thu, 11 Dec 2025 14:53:57 +0100 Subject: [PATCH 2/2] Simplify code to avoid using latest R functions --- R/utils.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/utils.R b/R/utils.R index 2982a94..2918d7a 100644 --- a/R/utils.R +++ b/R/utils.R @@ -23,10 +23,11 @@ fill_in <- function(list, names) { } output_dir <- function() { - opt <- getOption("valreport_output_dir", default = NULL) - env <- Sys.getenv("VALREPORT_OUTPUT_DIR", unset = getwd()) - - opt %||% env + getOption("valreport_output_dir", + default = Sys.getenv("VALREPORT_OUTPUT_DIR", + unset = getwd() + ) + ) } rendering_dir <- function() {