tests/testthat/test-pak.R

test_that('`manifest_from_pak()` creates a valid TOML file with expected packages', {
  lockfile <- system.file(package = 'manifesto', 'pkg.lock')

  path <- manifest_from_pak(lockfile)
  expect_true(file.exists(path))

  toml <- tomledit::read_toml(path) |> tomledit::from_toml()
  deps <- toml$dependencies

  expect_type(deps, 'list')
  expect_named(deps, c('cli', 'pak', 'rlang', 'tomledit'))

  expect_equal(toml$environment$r_version, '4.5.1')
})

Try the manifesto package in your browser

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

manifesto documentation built on May 6, 2026, 1:06 a.m.