tests/testthat/test-testthat.R

test_that("using_testthat() works as expected", {
  withr::with_envvar(
    new = c("TESTTHAT" = "true"),
    expect_true(using_testthat())
  )

  withr::with_envvar(
    new = c("TESTTHAT" = NA),
    expect_false(using_testthat())
  )
})

Try the ami package in your browser

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

ami documentation built on April 4, 2025, 2:39 a.m.