tests/testthat/testConfigLoadAll/tests/testthat/test-config.R

test_that("helpers are not on the path", {
  expect_false(
    "my_helper" %in% names(rlang::pkg_env("testConfigLoadAll"))
  )
})

test_that("internal functions are not on the path", {
  fns <- names(rlang::pkg_env("testConfigLoadAll"))
  expect_false("internal" %in% fns)
  expect_true("exported" %in% fns)
})

Try the testthat package in your browser

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

testthat documentation built on Oct. 6, 2023, 5:10 p.m.