tests/testthat/test-use_zephyr.R

test_that("use_zephyr", {
  skip_if_not_installed("withr")
  skip_if_not_installed("usethis")

  rlang::local_interactive(FALSE)
  withr::local_options(usethis.quiet = TRUE)

  mypkg <- withr::local_tempdir() |>
    file.path("mypkg")

  dir.create(mypkg)

  usethis::create_package(path = mypkg, rstudio = FALSE) |>
    capture.output()

  usethis::with_project(mypkg, {
    use_zephyr() |>
      expect_invisible() |>
      expect_true() |>
      expect_snapshot()

    file.exists("R/mypkg-options.R") |>
      expect_true()
  })
})

Try the zephyr package in your browser

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

zephyr documentation built on Aug. 22, 2025, 9:09 a.m.