test_skeleton {testthis}R Documentation

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

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

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()


[Package testthis version 1.1.1 Index]