| test_package {testthat} | R Documentation |
Test are run in an environment that inherits from the package's namespace
environment, so that tests can access non-exported functions and variables.
Tests should be placed in tests/testthat. Use test_check with
R CMD check and test_pacakge interactively at the console.
test_package(package, filter = NULL, reporter = "summary", ...) test_check(package, filter = NULL, reporter = "check", ...)
package |
package name |
filter |
If not |
reporter |
reporter to use |
... |
Additional arguments passed to |
the results as a "testthat_results" (list)
Create tests/testthat.R that contains:
library(testthat)
library(yourpackage)
test_check("yourpackage")
## Not run: test_package("testthat")