tests/testthat/test-api.R

# unit tests ====

test_that("user agent is properly set", {
  # knock out mailto
  withr::local_options(crlite.mailto = "")
  expect_equal(
    req_cr()$options$useragent,
    "crlite/0.0.0.9000(https://github.com/subugoe/crlite/)"
  )
})


# integration tests ====

test_that("api can be reached", {
  skip_if_offline()
  expect_true(can_api())
})
subugoe/crlite documentation built on Sept. 19, 2021, 3:25 a.m.