tests/testthat/test-exported-values.R

sleep_on_ci()
app <- ShinyDriver$new(test_path("apps/test-exports/"))

test_that("Exported values", {
  x <- app$getAllValues()
  expect_identical(x$export$x, 1)
  expect_identical(x$export$y, 2)

  app$setInputs(inc = "click")
  app$setInputs(inc = "click")

  x <- app$getAllValues()
  expect_identical(x$export$x, 3)
  expect_identical(x$export$y, 4)
})

Try the shinytest package in your browser

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

shinytest documentation built on March 31, 2023, 11:09 p.m.