tests/testthat/test-golem-recommended.R

test_that("app ui", {
  ui <- app_ui()
  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_is(server, "function")
  # Check that formals have not been removed
  fmls <- formals(app_server)
  for (i in c("input", "output", "session")) {
    expect_true(i %in% names(fmls))
  }
})

# Added from 0.3.2
test_that(
  "app_sys works",
  {
    expect_true(
      app_sys("golem-config.yml") != ""
    )
  }
)

# Configure this test to fit your need
test_that(
  "app launches", {
    # This one is broken:
    # golem::expect_running(sleep = 5)
  }
)
xaviermiles/statsnz.odata documentation built on April 14, 2022, 12:53 p.m.