tests/testthat/test-test_helpers.R

test_that("test expect_shinytag", {
  with_dir(pkg, {
    withr::with_options(
      c("golem.quiet" = FALSE),
      {
        expect_equal(capture_output(expect_shinytag(favicon("jean"))), "")
        expect_error(expect_shinytag("pierre"))
      }
    )
  })
})

test_that("test expect_shinytaglist", {
  with_dir(pkg, {
    withr::with_options(
      c("golem.quiet" = FALSE),
      {
        expect_equal(capture_output(expect_shinytaglist(shiny::tagList())), "")
        expect_error(expect_shinytaglist("test"))
      }
    )
  })
})

Try the golem package in your browser

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

golem documentation built on June 7, 2023, 5:46 p.m.