report_side_effects | R Documentation |
Call this function from within a test file to report side effects.
report_side_effects( report = TRUE, envvar = report, pwd = report, files = report, locale = report )
report |
|
envvar |
|
pwd |
|
files |
|
locale |
|
A named logical
, indicating which aspects of the environment
are tracked, invisibly.
A side effect causes a change in an external variable outside of the scope of a function, or test file. This includes environment variables, global options, global R variables, creating files or directories, and so on.
If this function is called in a test file, side effects are monitored from that point in the file and only for that file. The state of the environment before and after running every expression in the file are compared.
There is some performance penalty in tracking external variables, especially for those that require a system call.
There could be side-effects that are untrackable by tinytest. This includes packages that use a global internal state within their namespace or packages that use a global state within compiled code.
# switch on report_side_effects() # switch off report_side_effects(FALSE) # only report changes in environment variables report_side_effects(report=FALSE, envvar=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.