test_file | R Documentation |
Helper, setup, and teardown files located in the same directory as the
test will also be run. See vignette("special-files")
for details.
test_file(
path,
reporter = default_compact_reporter(),
desc = NULL,
package = NULL,
...
)
path |
Path to file. |
reporter |
Reporter to use to summarise output. Can be supplied
as a string (e.g. "summary") or as an R6 object
(e.g. See Reporter for more details and a list of built-in reporters. |
desc |
Optionally, supply a string here to run only a single
test ( |
package |
If these tests belong to a package, the name of the package. |
... |
Additional parameters passed on to |
A list (invisibly) containing data about the test results.
Each test is run in a clean environment to keep tests as isolated as possible. For package tests, that environment inherits from the package's namespace environment, so that tests can access internal functions and objects.
path <- testthat_example("success")
test_file(path)
test_file(path, desc = "some tests have warnings")
test_file(path, reporter = "minimal")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.