From 701d4c4528344084bf9bc6f9913613afc8c78820 Mon Sep 17 00:00:00 2001 From: jtlandis Date: Sun, 25 Feb 2024 19:41:02 -0500 Subject: [PATCH] Manually making `expect_doppleganger` alias --- tests/testthat.R | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/testthat.R b/tests/testthat.R index 86bd7d3..f543b4a 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,6 +1,19 @@ library(testthat) -library(vdiffr) library(ggplot2) library(ggside) +if ((nzchar(Sys.getenv("CI")) || + !nzchar(Sys.getenv("NOT_CRAN"))) && + identical(Sys.getenv("VDIFFR_RUN_TESTS"), 'false')) { + #if we are running tests remotely AND + # we are opting out of using vdiffr + # assigning a dummy function + + expect_doppelganger <- function(...) { + testthat::skip("`VDIFFR_RUN_TESTS` set to false on this remote check") + } +} else { + expect_doppelganger <- vdiffr::expect_doppelganger +} + test_check("ggside")