tests/testthat/test-utils_sitrep.R

test_that("sitrep works", {
  skip_on_cran()
  nflreadr_sitrep <- .sitrep(c("nflreadr","data.table"), recursive = FALSE)
  expect_named(
    nflreadr_sitrep,
    c("system_info", "installed", "dependencies", "package_options",
      "not_installed", "packages", "timestamp")
  )

  xyz_sitrep <- .sitrep("xyz", recursive = FALSE)

  expect_true(
    all(lengths(xyz_sitrep[c("installed", "dependencies", "package_options")]) == 0)
  )

  expect_output(
    print(nflreadr_sitrep),
    regexp = "System Info|R version |Running under|Packages|nflreadr \\("
  )
})

Try the nflreadr package in your browser

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

nflreadr documentation built on Sept. 8, 2023, 5:57 p.m.