tests/testthat/test-pas_leaflet.R

context("test-pas_leaflet")

test_that("input validation works", {
  data("example_pas")
  expect_error(pas_leaflet(1:10))
  expect_error(pas_leaflet(example_pas, param="PM2.5"))
  expect_error(pas_leaflet(example_pas, outsideOnly = 'outside'))
  expect_error(pas_leaflet(example_pas, radius=NA))
})

test_that("leaflet class returned", { 
  expect_true(is(pas_leaflet(example_pas), "leaflet"))
})

Try the AirSensor package in your browser

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

AirSensor documentation built on March 13, 2021, 1:07 a.m.