Run tests for a Shiny application
testApp(
appDir = ".",
testnames = NULL,
quiet = FALSE,
compareImages = TRUE,
interactive = is_interactive(),
suffix = NULL
)
Path to directory containing a Shiny app (e.g. app.R
) or
single interactive .Rmd
.
Test script(s) to run. The .R extension of the filename is
optional. For example, "mytest"
or c("mytest", "mytest2.R")
.
If NULL
(the default), all scripts in the tests/ directory will be
run.
Should output be suppressed? This is useful for automated testing.
Should screenshots be compared? It can be useful to set
this to FALSE
when the expected results were taken on a different
platform from the one currently being used to test the application.
If there are any differences between current results and expected results, provide an interactive graphical viewer that shows the changes and allows the user to accept or reject the changes.
An optional suffix for the expected results directory. For
example, if the suffix is "mac"
, the expected directory would be
mytest-expected-mac
.
snapshotCompare()
and snapshotUpdate()
if
you want to compare or update snapshots after testing. In most cases, the
user is prompted to do these tasks interactively, but there are also times
where it is useful to call these functions from the console.