test {devtools} | R Documentation |
Execute testthat tests in a package
Description
-
test()
runs all tests in a package. It's a shortcut fortestthat::test_dir()
-
test_active_file()
runstest()
on the active file. -
test_coverage()
computes test coverage for your package. It's a shortcut forcovr::package_coverage()
pluscovr::report()
. -
test_coverage_active_file()
computes test coverage for the active file. It's a shortcut forcovr::file_coverage()
pluscovr::report()
.
Usage
test(pkg = ".", filter = NULL, stop_on_failure = FALSE, export_all = TRUE, ...)
test_active_file(file = find_active_file(), ...)
test_coverage(pkg = ".", show_report = interactive(), ...)
test_coverage_active_file(
file = find_active_file(),
filter = TRUE,
show_report = interactive(),
export_all = TRUE,
...
)
Arguments
pkg |
The package to use, can be a file path to the package or a
package object. See |
filter |
If not |
stop_on_failure |
If |
export_all |
If |
... |
additional arguments passed to wrapped functions. |
file |
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). |
show_report |
Show the test coverage report. |