
Executes all ./R
files and global.R
into the current environment.
This is useful when wanting access to functions or values created in the ./R
folder for testing purposes.
load_app_env(
app_dir = "../../",
renv = rlang::caller_env(),
globalrenv = rlang::caller_env()
)
The base directory for the Shiny application.
The environment in which the files in the `R/`` directory should be evaluated.
The environment in which global.R
should be evaluated. If
NULL
, global.R
will not be evaluated at all.
Loading these files is not automatically performed by test_app()
and must
be called in ./tests/testthat/setup-shinytest2.R
if access to support file objects is
desired.
use_shinytest2()
for creating a testing setup file that
loads your Shiny app support environment into the testing environment.