test_skeleton: Create a test skeleton file for the currently open .R file

Description Usage Arguments Value Side effects See Also

View source: R/test_skeleton.R

Description

If the file currently open in the RStudio editor is called my_function.R, this creates the file ‘/tests/testthat/test_my_function.R’ and fills it with a basic test skeleton.

Usage

1
test_skeleton(fname = NULL, open = TRUE, sep = options("testthis.sep"))

Arguments

fname

character scalar. Target R script file to open. If empty the file currently open in the editor will be used.

open

logical scalar. Should the test file be opened after it is created?

sep

character scalar. Separator between ‘test’ and ‘fname’ when constructing the test file name. Should either be "_" or "-" for compatibility with testthat.

Value

NULL (invisibly)

Side effects

Creates an R script file in the file system.

See Also

usethis::use_test()


testthis documentation built on April 14, 2020, 6:23 p.m.