tests/testthat/test-create_test_update_fns.R

test_that("Error happens when update function has no session argument", {
  local_mocked_bindings(!!!create_test_update_fns("selectInput"), .package = "shiny")

  expect_error(
    shiny::selectInput(inputId = "select", label = "Label"),
    "Unable to determine session argument for `selectInput()`",
    fixed = TRUE
  )
})

Try the shinytesters package in your browser

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

shinytesters documentation built on Sept. 1, 2025, 5:10 p.m.