diff --git a/tests/testthat/helper-vdiffr.R b/tests/testthat/helper-vdiffr.R index bf132c875e..9fa69eb1a6 100644 --- a/tests/testthat/helper-vdiffr.R +++ b/tests/testthat/helper-vdiffr.R @@ -1,12 +1,12 @@ -# vdiffr ignores failures when -# - VDIFFR_RUN_TESTS is "false" (on Travis CI with older versions and dev version of R) -# - CI is not set (on CRAN) +# By default, if vdiffr is not installed, all visual tests are skipped unless +# VDIFFR_RUN_TESTS is explicitly set to "true", which should be the case only on +# a GitHub Actions CI runner with stable version of R. if (requireNamespace("vdiffr", quietly = TRUE)) { expect_doppelganger <- vdiffr::expect_doppelganger } else { - # If vdiffr is not available and visual tests are not explicitly disabled, raise error. - if (!identical(Sys.getenv("VDIFFR_RUN_TESTS"), "false")) { + # If vdiffr is not available and visual tests are explicitly required, raise error. + if (identical(Sys.getenv("VDIFFR_RUN_TESTS"), "true")) { abort("vdiffr is not installed") }