@@ -4,6 +4,7 @@ context("MCMC: combo")
44source(test_path(" data-for-mcmc-tests.R" ))
55
66test_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 ----------------------------------
2829test_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 ------------------------------------------------------------
4446test_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