tests/testthat/test-summary.fv_posterior.R

test_that("Can summarise forecasts", {
  skip_on_cran()
  expect_true(
    any(
      class(
        summary(
          posterior2,
          type = "all"
        )
      ) %in% "fv_posterior"
    )
  )
  expect_true(
    any(
      class(
        summary(
          posterior2,
          type = "all"
        )
      ) %in% "fv_posterior"
    )
  )
  expect_true(
    all(
      grepl(
        "r",
        summary(
          posterior2,
          type = "rt"
        )$variable
      )
    )
  )
  expect_true(
    all(
      summary(posterior2, forecast = TRUE, type = "rt")$date
      >= as.Date("2021-03-20")
    )
  )
})
epiforecasts/forecast.vocs documentation built on May 14, 2023, 2 p.m.