use_testthat {usethis}R Documentation

Create tests

Description

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.

Usage

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

The testing chapter of R Packages.


[Package usethis version 1.4.0 Index]