Skip to content

Commit 9da6127

Browse files
committed
Remove lubridate dependency from tests
1 parent dabc78f commit 9da6127

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

R-packages/covidcast/tests/testthat/test-covidcast.R

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
library(covidcast)
22
library(httptest)
33
library(mockery)
4-
library(lubridate)
54
library(dplyr)
65

76
# Many of these tests use mockery::with_mock_api. This replaces calls to the
@@ -145,7 +144,7 @@ test_that("covidcast_days does not treat \"*\" as a missing geo_value", {
145144
signal = "signal",
146145
time_value = c(20201030, 20201031),
147146
direction = NA,
148-
issue = ymd("2020-11-04"),
147+
issue = as.Date("2020-11-04"),
149148
lag = 2,
150149
value = 3,
151150
stderr = NA,
@@ -156,8 +155,8 @@ test_that("covidcast_days does not treat \"*\" as a missing geo_value", {
156155
covidcast_days(
157156
data_source = "fb-survey",
158157
signal = "raw_cli",
159-
start_day = ymd("2020-10-30"),
160-
end_day = ymd("2020-10-31"),
158+
start_day = as.Date("2020-10-30"),
159+
end_day = as.Date("2020-10-31"),
161160
geo_type = "county",
162161
geo_value = c("*"),
163162
as_of = NULL,
@@ -174,7 +173,7 @@ test_that("covidcast_days does not raise warnings for full response", {
174173
signal = "signal",
175174
time_value = c(20201030, 20201031),
176175
direction = NA,
177-
issue = ymd("2020-11-04"),
176+
issue = as.Date("2020-11-04"),
178177
lag = 2,
179178
value = 3,
180179
stderr = NA,
@@ -185,8 +184,8 @@ test_that("covidcast_days does not raise warnings for full response", {
185184
covidcast_days(
186185
data_source = "fb-survey",
187186
signal = "raw_cli",
188-
start_day = ymd("2020-10-30"),
189-
end_day = ymd("2020-10-31"),
187+
start_day = as.Date("2020-10-30"),
188+
end_day = as.Date("2020-10-31"),
190189
geo_type = "county",
191190
geo_value = c("geoa"),
192191
as_of = NULL,
@@ -202,7 +201,7 @@ test_that("covidcast_days batches calls to covidcast", {
202201
signal = "signal",
203202
time_value = rep(NA, 3),
204203
direction = NA,
205-
issue = ymd("2020-11-04"),
204+
issue = as.Date("2020-11-04"),
206205
lag = 2,
207206
value = 3,
208207
stderr = NA,
@@ -217,8 +216,8 @@ test_that("covidcast_days batches calls to covidcast", {
217216
covidcast_days(
218217
data_source = "fb-survey",
219218
signal = "raw_cli",
220-
start_day = ymd("2020-10-01"),
221-
end_day = ymd("2020-10-06"),
219+
start_day = as.Date("2020-10-01"),
220+
end_day = as.Date("2020-10-06"),
222221
geo_type = "county",
223222
geo_value = "*",
224223
as_of = NULL,

0 commit comments

Comments
 (0)