use_testthat() sets up testing infrastructure, creating tests/testthat.R and tests/testthat/, and adding testthat to the suggested packages. use_test() creates tests/testthat/test-<name>.R and opens it for editing.

use_testthat()

use_test(name = NULL, open = interactive())

Arguments

name

Test name. if NULL, and you're using RStudio, will use the name of the file open in the source editor.

open

Open the newly created file for editing? Happens in RStudio, if applicable, or via utils::file.edit() otherwise.

See also