tests/testthat/test-plot_monthly_stats.R

context("Plot monthly stats")

test_that("a list of plots is created", {
  skip_on_cran()
  skip_on_ci()
  plots <- plot_monthly_stats(station_number = "08NM116", start_year = 1980)
  expect_true("list" %in% class(plots) & "gg" %in% sapply(plots, class))
})

test_that("two plots are created by default", {
  skip_on_cran()
  skip_on_ci()
  plots <- plot_monthly_stats(station_number = c("08NM116"), start_year = 1980)
  expect_true(length(plots) == 4)
})

test_that("multiple plots are created with multiple groups", {
  skip_on_cran()
  skip_on_ci()
  plots <- plot_monthly_stats(station_number = c("08NM116","08HB048"), start_year = 1980)
  expect_true(length(plots) == 8)
})

Try the fasstr package in your browser

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

fasstr documentation built on Sept. 30, 2024, 9:24 a.m.