tests/testthat/helper.R

# Test helpers for partycoloR

# Skip if no internet connection
skip_if_offline <- function() {
  tryCatch(
    {
      con <- url("https://en.wikipedia.org", "r")
      close(con)
    },
    error = function(e) {
      skip("No internet connection")
    }
  )
}

# Skip network tests on CI to avoid flaky builds
# Wikipedia and GitHub may rate-limit or block CI runners
skip_on_ci_network <- function() {
  skip_on_ci()
  skip_if_offline()
}

Try the partycoloR package in your browser

Any scripts or data that you put into this service are public.

partycoloR documentation built on Jan. 28, 2026, 1:07 a.m.