initTestthat | R Documentation |
This function scans all files in the specified R directory based on its name,
excluding some based on the patterns provided in the ignore
argument,
and creates testthat
files if they are missing. Useful for when many source
code files were created from rapid development and unit testing has yet to be
setup.
initTestthat(
rDir = "R",
testDir = file.path("tests", "testthat"),
.ignore = c("-package.R$", "-class.R$", "^data.R$", "^zzz.R$", "^RcppExports.R$"),
ignore = NULL
)
rDir |
The directory containing R source files. Default is "R". |
testDir |
The directory where |
.ignore |
A character vector specifying regex patterns of files to
ignore. Defaults
to common patterns |
ignore |
A character vector of extra regex patterns of R files to ignore |
No return value, called for side effects.
try({
initTestthat()
initTestthat(rDir = "src", testDir = "tests")
initTestthat(ignore = c("^foo", "-bar.R$"))
}, silent = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.