There are two helper functions:
use_testthat() sets up overall testing infrastructure: creates
tests/testthat/, tests/testthat.R, and adds testthat to Suggests.
use_test() sets up individual test files: creates
tests/testthat/test-<name>.R and, optionally, opens it for editing.
use_testthat() use_test(name = NULL, open = interactive())
| name | Base of test file name. If |
|---|---|
| open | Open the newly created file for editing? Happens in RStudio, if
applicable, or via |
The testing chapter of R Packages.
if (FALSE) { use_testthat() use_test() use_test("something-management") }