tests/testthat/test-ipgeo.R

test_that("ipgeo errors when api_key is missing", {
  expect_error(
    ipgeo("8.8.8.8", api_key = ""),
    "api_key"
  )
})

test_that("ipgeo errors when ip is not character", {
  expect_error(
    ipgeo(123, api_key = "test"),
    "character"
  )
})

test_that("include does not allow dot notation", {
  expect_error(
    ipgeo("8.8.8.8",
          api_key = "test",
          include = "security.level"),
    "dot notation"
  )
})

Try the ipgeolocation package in your browser

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

ipgeolocation documentation built on April 7, 2026, 9:08 a.m.