tests/testthat/test-site_timeline.R

# Run all tests in this script:
## testthat::test_file(file.path("tests", "testthat", "test-site_timeline.R"))

# Simple error testing
## Unnecessary because `site_subset` is doing brunt of input checking

# Warning testing
test_that("Warnings are returned",{
  expect_warning(site_timeline(sites = c("NWT", "LUQ", "ARC"), colors = "#67CDAA"))
})

# Output testing
test_that("Outputs are correct", {
  time_gg <- site_timeline(sites = c("NWT", "LUQ", "ARC"))
  expect_equal(class(time_gg), c("gg", "ggplot"))
})

Try the ltertools package in your browser

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

ltertools documentation built on April 11, 2025, 6:14 p.m.