tests/testthat/helper.R

local_s4_class <- function(Class, ..., .local_envir = parent.frame()) {
  methods::setClass(Class, ...)
  withr::defer(methods::removeClass(Class), envir = .local_envir)
  invisible(Class)
}

Try the chk package in your browser

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

chk documentation built on Sept. 3, 2026, 9:07 a.m.