use_shinytest2 {shinytest2}R Documentation

Use shinytest2 with your Shiny application

Description

Use shinytest2 with your Shiny application

Usage

use_shinytest2(
  app_dir = ".",
  runner = missing_arg(),
  setup = missing_arg(),
  ignore = missing_arg(),
  package = missing_arg(),
  ...,
  quiet = FALSE,
  overwrite = FALSE
)

use_shinytest2_test(
  app_dir = ".",
  open = rlang::is_interactive(),
  quiet = FALSE,
  overwrite = FALSE
)

Arguments

app_dir

The base directory for the Shiny application

runner

If TRUE, creates a shinytest2 test runner at ./tests/testthat.R

setup

If TRUE, creates a setup file called ./tests/testthat/setup-shinytest2.R containing a call to load_app_env()

ignore

If TRUE, adds entries to .Rbuildignore and .gitignore to ignore new debug screenshots. (⁠*_.new.png⁠)

package

If TRUE, adds shinytest2 to Suggests in the DESCRIPTION file.

...

Must be empty. Allows for parameter expansion.

quiet

If TRUE, console output will be suppressed.

overwrite

If TRUE, the test file or test runner will be overwritten.

open

If TRUE, the test file will be opened in an editor via file.edit() after saving.

Functions

Examples

# Set up shinytest2 testing configs
## Not run: use_shinytest2()
# Set up a shinytest2 test
## Not run: use_shinytest2_test()

[Package shinytest2 version 0.3.2 Index]