tests/testthat/test-package.R

test_that("package_file() gives useful errors", {
  expect_snapshot(error = TRUE, {
    package_file(path = 1)
    package_file(path = "doesntexist")
    package_file(path = "/")
  })
})

test_that("create argument is deprecated", {
  path <- local_package_create()
  expect_snapshot(x <- as.package(path, create = TRUE))
})

Try the devtools package in your browser

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

devtools documentation built on Oct. 12, 2022, 1:06 a.m.