tests/testthat/test-app-hello-init-args.R

test_that("name arg works", {
  skip_if_no_apps()

  app <- AppDriver$new(
    test_path("apps/hello"),
    name = "test",
    variant = NULL
  )

  app$set_inputs(name = "Hadley")
  app$set_inputs(greet = "click")
  app$expect_values(output = "greeting", screenshot_args = FALSE)
  app$expect_values(
    output = "greeting",
    screenshot_args = FALSE,
    name = "custom"
  )
})

Try the shinytest2 package in your browser

Any scripts or data that you put into this service are public.

shinytest2 documentation built on Jan. 10, 2026, 1:07 a.m.