Skip to content

Commit

Permalink
Make test more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Dec 6, 2023
1 parent 57d7e44 commit 827973b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
9 changes: 0 additions & 9 deletions tests/testthat/_snaps/anomalize.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
# gesd can handle low variance data

Code
low_var %>% time_decompose(count, method = "stl") %>% anomalize(remainder,
method = "gesd") %>% expect_message("Converting")
Message
frequency = 7 days
trend = 91 days
Registered S3 method overwritten by 'quantmod':
method from
as.zoo.data.frame zoo
Code
low_var %>% time_decompose(count, method = "twitter") %>% anomalize(remainder,
method = "gesd") %>% expect_message("Converting")
Expand Down
11 changes: 7 additions & 4 deletions tests/testthat/test-anomalize.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,14 @@ test_that("gesd can handle low variance data", {
anomalize(count, method = "gesd") %>%
expect_no_error()
# Capture messages in snapshots
low_var %>%
time_decompose(count, method = "stl") %>%
anomalize(remainder, method = "gesd") %>%
expect_message("Converting") %>%
expect_message("frequency") %>%
expect_message("trend")
expect_snapshot({
low_var %>%
time_decompose(count, method = "stl") %>%
anomalize(remainder, method = "gesd") %>%
expect_message("Converting")


low_var %>%
time_decompose(count, method = "twitter") %>%
Expand Down

0 comments on commit 827973b

Please sign in to comment.