diff --git a/tests/testthat/test-ets.R b/tests/testthat/test-ets.R index 1a4ec6e1..6ee9bd25 100644 --- a/tests/testthat/test-ets.R +++ b/tests/testthat/test-ets.R @@ -1,4 +1,5 @@ context("test-ets.R") +skip_if_not_installed("forecast") forecast_fit <- USAccDeaths %>% forecast::ets() test_that("Automatic ETS selection", { diff --git a/tests/testthat/test-lm.R b/tests/testthat/test-lm.R index 79edefaf..02fd73b1 100644 --- a/tests/testthat/test-lm.R +++ b/tests/testthat/test-lm.R @@ -1,6 +1,8 @@ context("test-lm.R") test_that("LM", { + skip_if_not_installed("forecast") + # NULL model selection fable_fit <- USAccDeaths_tbl %>% model(lm = TSLM(value)) forecast_fit <- lm(USAccDeaths ~ 1) diff --git a/tests/testthat/test-nnetar.R b/tests/testthat/test-nnetar.R index d3f78a7b..e74f1da6 100644 --- a/tests/testthat/test-nnetar.R +++ b/tests/testthat/test-nnetar.R @@ -1,4 +1,5 @@ context("test-nnetar") +skip_if_not_installed("nnet") airmiles <- as_tsibble(airmiles) test_that("Automatic NNETAR selection", { diff --git a/tests/testthat/test-rw.R b/tests/testthat/test-rw.R index 6089c2e0..f674596e 100644 --- a/tests/testthat/test-rw.R +++ b/tests/testthat/test-rw.R @@ -1,5 +1,6 @@ context("test-rw.R") test_that("NAIVE", { + skip_if_not_installed("forecast") fable_fit <- USAccDeaths_tbl %>% model(naive = NAIVE(value)) forecast_fc <- forecast::naive(USAccDeaths, h = 12) @@ -21,6 +22,7 @@ test_that("NAIVE", { }) test_that("RW w/ drift", { + skip_if_not_installed("forecast") fable_fit <- USAccDeaths_tbl %>% model(rw = RW(value ~ drift())) forecast_fc <- forecast::rwf(USAccDeaths, drift = TRUE, h = 12) @@ -70,6 +72,7 @@ test_that("RW w/ drift", { }) test_that("SNAIVE", { + skip_if_not_installed("forecast") fable_fit <- USAccDeaths_tbl %>% model(snaive = SNAIVE(value)) forecast_fc <- forecast::snaive(USAccDeaths, h = 12)