tests/testthat/test-bundle_resources.R

test_that("multiplication works", {
  run_quietly_in_a_dummy_golem({
    add_css_file(
      pkg = ".",
      "bundle",
      open = FALSE
    )
    add_js_file(
      pkg = ".",
      "bundle",
      open = FALSE
    )
    res <- bundle_resources(
      path = "inst/app/www",
      app_title = "fakename",
      with_sparkles = TRUE
    )
    expect_equal(
      length(res),
      3
    )
    expect_true(
      inherits(res[[1]], "html_dependency")
    )
    expect_true(
      inherits(res[[2]], "shiny.tag")
    )
    expect_true(
      inherits(res[[3]], "html_dependency")
    )
  })
})

Try the golem package in your browser

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

golem documentation built on Sept. 11, 2024, 7:54 p.m.