tests/testthat/test-addVarEEcollection.R

test_that("returns a deprecation message", {
  lifecycle::expect_deprecated(addVarEEcollection(ee_pentads = ee_data,
                                                  collection = "IDAHO_EPSCOR/TERRACLIMATE",
                                                  dates = c("2010-01-01", "2011-01-01"),
                                                  temp_reducer = "mean",
                                                  spt_reducer = "mean",
                                                  bands = "tmmn"))
})


test_that("informs about an alternative", {
  expect_message(addVarEEcollection(ee_pentads = ee_data,
                                    collection = "IDAHO_EPSCOR/TERRACLIMATE",
                                    dates = c("2010-01-01", "2011-01-01"),
                                    temp_reducer = "mean",
                                    spt_reducer = "mean",
                                    bands = "tmmn"),
                 regexp = "This function has been discontinued. Please, use ABDtools::addVarEEcollection() instead",
                 fixed = TRUE)
})
AfricaBirdData/ABAP documentation built on Aug. 4, 2024, 4:41 p.m.