tests/testthat/test-us_congressional.R

test_that("Returns current congressional districts", {
  skip_if_not_installed("USAboundariesData")
  expect_identical(
    us_congressional(),
    USAboundariesData::congress_contemporary_lores
  )
})

# test_that("States can be filtered", {
# })

test_that("Correct resolution shapefiles are returned", {
  skip_if_not_installed("USAboundariesData")
  expect_identical(
    us_congressional(resolution = "low"),
    USAboundariesData::congress_contemporary_lores
  )
  expect_identical(
    us_congressional(resolution = "high"),
    USAboundariesData::congress_contemporary_hires
  )
})

Try the USAboundaries package in your browser

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

USAboundaries documentation built on Jan. 30, 2026, 1:07 a.m.