Skip to content

Commit abbb41d

Browse files
Skip tests depending on Suggested dependency gridExtra
1 parent b8261f9 commit abbb41d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/testthat/test-mcmc-combo.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ context("MCMC: combo")
44
source(test_path("data-for-mcmc-tests.R"))
55

66
test_that("mcmc_combo returns a gtable object", {
7+
skip_if_not_installed("gridExtra")
78
expect_gtable(mcmc_combo(arr, regex_pars = "beta"))
89
expect_gtable(mcmc_combo(arr, regex_pars = "beta",
910
gg_theme = ggplot2::theme_dark()))
@@ -26,6 +27,7 @@ test_that("mcmc_combo returns a gtable object", {
2627

2728
# functions that require multiple chains ----------------------------------
2829
test_that("mcmc_combo throws error if 1 chain but multiple chains required", {
30+
skip_if_not_installed("gridExtra")
2931
expect_error(mcmc_combo(arr1chain, regex_pars = "beta",
3032
combo = c("trace_highlight", "dens")),
3133
"requires multiple chains")
@@ -42,6 +44,7 @@ test_that("mcmc_combo throws error if 1 chain but multiple chains required", {
4244

4345
# other errors ------------------------------------------------------------
4446
test_that("mcmc_combo throws errors", {
47+
skip_if_not_installed("gridExtra")
4548
expect_error(mcmc_combo(arr, combo = c("trace_highlight")),
4649
"'combo' should have at least two elements")
4750
expect_error(mcmc_combo(arr, regex_pars = "beta",

0 commit comments

Comments
 (0)