diff --git a/tests/testthat/setup-logger.R b/tests/testthat/setup-logger.R index f6401f548..69c1394c7 100644 --- a/tests/testthat/setup-logger.R +++ b/tests/testthat/setup-logger.R @@ -1 +1,3 @@ -logger::log_appender(function(...) NULL, namespace = "teal.modules.general") +if (requireNamespace("logger", quietly = TRUE)) { + logger::log_appender(function(...) NULL, namespace = "teal.modules.general") +} diff --git a/tests/testthat/test-examples.R b/tests/testthat/test-examples.R index 7acbd0a6d..a82ee89dc 100644 --- a/tests/testthat/test-examples.R +++ b/tests/testthat/test-examples.R @@ -145,6 +145,7 @@ for (i in rd_files()) { paste0("example-", basename(i)), { skip_if_too_deep(5) + testthat::skip_if_not_installed("pkgload") if (basename(i) %in% strict_exceptions) { op <- options() withr::local_options(opts_partial_match_old) diff --git a/tests/testthat/test-shinytest2-tm_data_table.R b/tests/testthat/test-shinytest2-tm_data_table.R index c6330d43d..7920c0c90 100644 --- a/tests/testthat/test-shinytest2-tm_data_table.R +++ b/tests/testthat/test-shinytest2-tm_data_table.R @@ -44,6 +44,7 @@ test_that("e2e - tm_data_table: Verify checkbox displayed over data table", { }) test_that("e2e - tm_data_table: Verify module displays data table", { + testthat::skip_if_not_installed("rvest") skip_if_too_deep(5) app_driver <- app_driver_tm_data_table() diff --git a/tests/testthat/test-shinytest2-tm_file_viewer.R b/tests/testthat/test-shinytest2-tm_file_viewer.R index 7a6eb12c6..a55685aad 100644 --- a/tests/testthat/test-shinytest2-tm_file_viewer.R +++ b/tests/testthat/test-shinytest2-tm_file_viewer.R @@ -17,6 +17,7 @@ app_driver_tm_file_viewer <- function() { } test_that("e2e - tm_file_viewer: Initializes without errors and shows files tree specified in input_path argument", { + testthat::skip_if_not_installed("rvest") skip_if_too_deep(5) app_driver <- app_driver_tm_file_viewer() @@ -42,6 +43,7 @@ test_that("e2e - tm_file_viewer: Initializes without errors and shows files tree }) test_that("e2e - tm_file_viewer: Shows selected image file", { + testthat::skip_if_not_installed("rvest") skip_if_too_deep(5) app_driver <- app_driver_tm_file_viewer() @@ -58,6 +60,7 @@ test_that("e2e - tm_file_viewer: Shows selected image file", { }) test_that("e2e - tm_file_viewer: Shows selected text file", { + testthat::skip_if_not_installed("rvest") skip_if_too_deep(5) app_driver <- app_driver_tm_file_viewer() diff --git a/tests/testthat/test-shinytest2-tm_misssing_data.R b/tests/testthat/test-shinytest2-tm_misssing_data.R index af35629ab..b1ea91429 100644 --- a/tests/testthat/test-shinytest2-tm_misssing_data.R +++ b/tests/testthat/test-shinytest2-tm_misssing_data.R @@ -147,6 +147,7 @@ test_that("e2e - tm_missing_data: Validate functionality and UI response for 'By }) test_that("e2e - tm_missing_data: Validate 'By Variable Levels' table values", { + testthat::skip_if_not_installed("rvest") skip_if_too_deep(5) app_driver <- app_driver_tm_missing_data()