tests/testthat/test-golem-recommended.R

test_that("app ui", {
  ui <- app_ui(NULL)
  golem::expect_shinytaglist(ui)
  # Check that formals have not been removed
  fmls <- formals(app_ui)
  for (i in c("request")) {
    expect_true(i %in% names(fmls))
  }
})

test_that("app server", {
  server <- app_server
  expect_type(server, "closure")
  # Check that formals have not been removed
  fmls <- formals(app_server)
  for (i in c("input", "output", "session")) {
    expect_true(i %in% names(fmls))
  }
})
grddavies/shinycalculator documentation built on Jan. 8, 2022, 12:07 a.m.