Similar to testthat::test_local(), it runs all tests in a package except those skipped by testthat::skip_on_cran(), using withr::local_envvar(NOT_CRAN = "false").

test_local_as_cran(path = ".", reporter = NULL, ..., load_package = "source")

Arguments

path

Path to directory containing tests.

reporter

Reporter to use to summarise output. Can be supplied as a string (e.g. "summary") or as an R6 object (e.g. SummaryReporter$new()).

See Reporter for more details and a list of built-in reporters.

...

Additional arguments passed to test_dir()

load_package

Strategy to use for load package code:

  • "none", the default, doesn't load the package.

  • "installed", uses library() to load an installed package.

  • "source", uses pkgload::load_all() to a source package. To configure the arguments passed to load_all(), add this field in your DESCRIPTION file:

    Config/testthat/load-all: list(export_all = FALSE, helpers = FALSE)