new_test(fun, path = "tests/testthat", file.name = NULL)
function
or character string naming the
function."tests/testthat"
for ease of use within RStudio.fun
+ ".R".
This can be changed by supplying a file name to file.name
.Generates a test-____.R file.
Quickly produce a testthat style
test .R template file from a function
(output file
will include the function) or a character string.
dir.create("temp_dir") new_test(paste, "temp_dir")test file created: temp_dir/test-paste.Rnew_test("myfun", "temp_dir")test file created: temp_dir/test-myfun.Runlink("temp_dir", TRUE, TRUE)