tests/test-modules/12_counter/tests/testthat/test-server.R

# Use testthat just for expectations
testServer(expr = {
  # Set the `size` slider and check the output
  session$setInputs(size = 6)
  expect_equal(output$sequence, "1 2 3 4 5 6")

  session$setInputs(size = 12)
  expect_equal(output$sequence, paste0(lexical_sort(1:12), collapse = " "))
})

Try the shiny package in your browser

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

shiny documentation built on Nov. 18, 2023, 1:08 a.m.