test() is a shortcut for
testthat::test_dir(), it runs all of a
test() on the active file.
test_coverage() computes test coverage for your package. It is a shortcut
test_coverage_file() computes test coverage for the active file. Is a
test(pkg = ".", filter = NULL, stop_on_failure = FALSE, export_all = TRUE, ...)
test_coverage(pkg = ".", show_report = interactive(), ...)
uses_testthat(pkg = ".")
test_file(file = find_active_file(), ...)
test_coverage_file( file = find_active_file(), filter = TRUE, show_report = interactive(), export_all = TRUE, ... )
The package to use, can be a file path to the package or a
package object. See
as.package() for more information.
NULL, only tests with file names matching this
regular expression will be executed. Matching be performed on the file
name after it has been stripped of
TRUE, throw an error if any tests fail.
For historical reasons, the default value of
if you're calling
test_dir() you may want to consider explicitly setting
stop_on_failure = TRUE.
TRUE (the default), export all objects.
FALSE, export only the objects that are listed as exports
in the NAMESPACE file.
Show the test coverage report.
One or more source or test files. If a source file the corresponding test file will be run. The default is to use the active file in RStudio (if available).