From 152f6212eb46eeab4830fa63368176009687499e Mon Sep 17 00:00:00 2001 From: Maximilian Held Date: Thu, 9 Dec 2021 09:51:10 +0100 Subject: [PATCH] loop test over all languages --- R/test-helpers.R | 1 + tests/testthat/test-report.R | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/R/test-helpers.R b/R/test-helpers.R index 276d495f..321af93d 100644 --- a/R/test-helpers.R +++ b/R/test-helpers.R @@ -38,6 +38,7 @@ strategies <- list( ) #' Skipping unsupported strategies +#' @noRd skip_if_strategy_unsupported <- function(strategy_name = names(strategies)) { strategy_name <- rlang::arg_match(strategy_name) if (strategy_name == "multicore" && !future::supportsMulticore()) { diff --git a/tests/testthat/test-report.R b/tests/testthat/test-report.R index b8d164bd..918aa6cc 100644 --- a/tests/testthat/test-report.R +++ b/tests/testthat/test-report.R @@ -14,7 +14,14 @@ test_that("draft can be created from template", { }) test_that("parametrised report can be rendered", { - expect_invisible( - render_report(output_file = withr::local_tempfile(), quiet = TRUE) + purrr::walk( + .x = mc_langs, + .f = function(x) { + translator <- mc_translator() + translator$set_translation_language(x) + expect_invisible( + render_report(output_file = withr::local_tempfile(), quiet = TRUE) + ) + } ) })