tests/testthat/test-ard_total_n.survey.design.R

skip_if_not(is_pkg_installed("survey", reference_pkg = "cardx"))

test_that("ard_total_n.survey.design() works", {
  expect_snapshot(
    survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) |>
      ard_total_n()
  )
})

test_that("ard_total_n.survey.design() follows ard structure", {
  expect_silent(
    survey::svydesign(~1, data = as.data.frame(Titanic), weights = ~Freq) |>
      ard_total_n() |>
      cards::check_ard_structure(method = FALSE)
  )
})

Try the cardx package in your browser

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

cardx documentation built on Sept. 11, 2024, 9:12 p.m.