From abbb41d3123799d80dd73fb6ca37e40a96b08f56 Mon Sep 17 00:00:00 2001 From: Michael Chirico Date: Mon, 10 Jun 2024 13:22:07 -0700 Subject: [PATCH] Skip tests depending on Suggested dependency gridExtra --- tests/testthat/test-mcmc-combo.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/testthat/test-mcmc-combo.R b/tests/testthat/test-mcmc-combo.R index 8390876b..f657c1a9 100644 --- a/tests/testthat/test-mcmc-combo.R +++ b/tests/testthat/test-mcmc-combo.R @@ -4,6 +4,7 @@ context("MCMC: combo") source(test_path("data-for-mcmc-tests.R")) test_that("mcmc_combo returns a gtable object", { + skip_if_not_installed("gridExtra") expect_gtable(mcmc_combo(arr, regex_pars = "beta")) expect_gtable(mcmc_combo(arr, regex_pars = "beta", gg_theme = ggplot2::theme_dark())) @@ -26,6 +27,7 @@ test_that("mcmc_combo returns a gtable object", { # functions that require multiple chains ---------------------------------- test_that("mcmc_combo throws error if 1 chain but multiple chains required", { + skip_if_not_installed("gridExtra") expect_error(mcmc_combo(arr1chain, regex_pars = "beta", combo = c("trace_highlight", "dens")), "requires multiple chains") @@ -42,6 +44,7 @@ test_that("mcmc_combo throws error if 1 chain but multiple chains required", { # other errors ------------------------------------------------------------ test_that("mcmc_combo throws errors", { + skip_if_not_installed("gridExtra") expect_error(mcmc_combo(arr, combo = c("trace_highlight")), "'combo' should have at least two elements") expect_error(mcmc_combo(arr, regex_pars = "beta",