Skip to content

Commit

Permalink
Merge pull request #326 from MichaelChirico/patch-2
Browse files Browse the repository at this point in the history
Skip tests depending on Suggested dependency gridExtra
  • Loading branch information
jgabry authored Jun 24, 2024
2 parents b8261f9 + abbb41d commit 11e4aa8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/testthat/test-mcmc-combo.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()))
Expand All @@ -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")
Expand All @@ -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",
Expand Down

0 comments on commit 11e4aa8

Please sign in to comment.