tests/testthat/setup.R

skip_if_no_typst <- function() {
  testthat::skip_if_not(has_any_typst())
}

skip_if_no_internet <- function(site) {
  out <- NULL

  try({
    out <- curlGetHeaders(url = site)
  })

  if (is.null(out)) {
    testthat::skip('No internet connection')
  }
}

random_folder <- function(length = 8L) {
  paste0(sample(LETTERS, size = length), collapse = '')
}

Try the typr package in your browser

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

typr documentation built on June 8, 2025, 10:36 a.m.