Skip to content

Commit f5ef88b

Browse files
committed
clarify some test purposes
1 parent 1e76059 commit f5ef88b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

tests/testthat/test-layer_add_forecast_date.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,16 @@ test_that("forecast date works for daily", {
8787
# both forecast_date and epi_df are dates
8888
expect_identical(p$forecast_date[1], as.Date("2021-12-31"))
8989

90-
# forecast_date is a date while the epi_df uses years (ints)
90+
# the error happens at predict time because the
91+
# time_value train/test types don't match
9192
latest_yearly <- latest %>%
9293
unclass() %>%
9394
as.data.frame() %>%
9495
mutate(time_value = as.POSIXlt(time_value)$year + 1900L) %>%
9596
as_epi_df()
9697
expect_error(predict(wf1, latest_yearly))
9798

98-
# forecast_date is a string
99+
# forecast_date is a string, gets correctly converted to date
99100
wf2 <- add_frosting(
100101
wf,
101102
adjust_frosting(f, "layer_add_forecast_date", forecast_date = "2022-01-01")

tests/testthat/test-layer_add_target_date.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ test_that("target date works for daily and yearly", {
9898
# both target_date and epi_df are dates
9999
expect_identical(p$target_date[1], as.Date("2021-12-31") + 7L)
100100

101-
# target_date is a date while the epi_df uses years (ints)
101+
# the error happens at predict time because the
102+
# time_value train/test types don't match
102103
latest_bad <- latest %>%
103104
unclass() %>%
104105
as.data.frame() %>%

0 commit comments

Comments
 (0)