Skip to content

Commit 37eb64d

Browse files
Toggle the logic of skipping visual tests (#4310)
1 parent 0394b9f commit 37eb64d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/testthat/helper-vdiffr.R

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# vdiffr ignores failures when
2-
# - VDIFFR_RUN_TESTS is "false" (on Travis CI with older versions and dev version of R)
3-
# - CI is not set (on CRAN)
1+
# By default, if vdiffr is not installed, all visual tests are skipped unless
2+
# VDIFFR_RUN_TESTS is explicitly set to "true", which should be the case only on
3+
# a GitHub Actions CI runner with stable version of R.
44

55
if (requireNamespace("vdiffr", quietly = TRUE)) {
66
expect_doppelganger <- vdiffr::expect_doppelganger
77
} else {
8-
# If vdiffr is not available and visual tests are not explicitly disabled, raise error.
9-
if (!identical(Sys.getenv("VDIFFR_RUN_TESTS"), "false")) {
8+
# If vdiffr is not available and visual tests are explicitly required, raise error.
9+
if (identical(Sys.getenv("VDIFFR_RUN_TESTS"), "true")) {
1010
abort("vdiffr is not installed")
1111
}
1212

0 commit comments

Comments
 (0)