From 30ef669aab484de5e9d4abadc49cdde37ff0f4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Ver=C3=ADssimo?= <211358+averissimo@users.noreply.github.com> Date: Fri, 20 Dec 2024 09:18:02 +0000 Subject: [PATCH 1/2] TealAppDriver skips tests when shinytest2 or rvest are not installed (#1432) # Pull Request Part of https://github.com/insightsengineering/teal.modules.general/pull/774 See https://github.com/insightsengineering/teal.modules.general/pull/774#discussion_r1718027258 --- R/TealAppDriver.R | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/R/TealAppDriver.R b/R/TealAppDriver.R index 70eb0da6e9..f170e515a7 100644 --- a/R/TealAppDriver.R +++ b/R/TealAppDriver.R @@ -10,12 +10,15 @@ TealAppDriver <- R6::R6Class( # nolint: object_name. "TealAppDriver", inherit = { - if (!requireNamespace("shinytest2", quietly = TRUE)) { - stop("Please install 'shinytest2' package to use this class.") - } - if (!requireNamespace("rvest", quietly = TRUE)) { - stop("Please install 'rvest' package to use this class.") - } + lapply(c("testthat", "shinytest2", "rvest"), function(.x, use_testthat) { + if (!requireNamespace(.x, quietly = TRUE)) { + if (use_testthat) { + testthat::skip(sprintf("%s is not installed", .x)) + } else { + stop("Please install '", .x, "' package to use this class.", call. = FALSE) + } + } + }, use_testthat = requireNamespace("testthat", quietly = TRUE) && testthat::is_testing()) shinytest2::AppDriver }, # public methods ---- From 997da60fd983200f98e4dcaf12fa768e53291a1a Mon Sep 17 00:00:00 2001 From: averissimo Date: Fri, 20 Dec 2024 09:19:02 +0000 Subject: [PATCH 2/2] [skip actions] Bump version to 0.15.2.9097 --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6cef3851ed..397f7570cc 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Type: Package Package: teal Title: Exploratory Web Apps for Analyzing Clinical Trials Data -Version: 0.15.2.9096 -Date: 2024-12-19 +Version: 0.15.2.9097 +Date: 2024-12-20 Authors@R: c( person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-9533-457X")), diff --git a/NEWS.md b/NEWS.md index b9b3955f37..ee1a092bc5 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# teal 0.15.2.9096 +# teal 0.15.2.9097 ### New features