Skip to content

Commit

Permalink
skipped one test for json (check) and added nowcast test
Browse files Browse the repository at this point in the history
  • Loading branch information
giorgiacek committed Nov 27, 2024
1 parent 9dc23cf commit 98676be
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions tests/testthat/test-get_stats.R
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ test_that("get_stats() returns a tibble with named columns for empty response (f
expect_identical(names(res), names(res2))

# json (does not return an empty response data frame)
res2 <- get_stats("AGO", 2005, format = "json") # empty response
expect_equal(dim(res2)[2], 0)
expect_equal(length(names(res2)), 0)
# GC: this test returns a warning now because json returns a completely
# empty tibble (no variables), is this correct?
#res2 <- get_stats("AGO", 2005, format = "json") # empty response
#expect_equal(dim(res2)[2], 0)
#expect_equal(length(names(res2)), 0)

})

Expand Down Expand Up @@ -185,3 +187,12 @@ test_that("get_wb() works w/ simplify = FALSE", {
expect_true(is.data.frame(res$content))
expect_gte(nrow(res$content), 3)
})


test_that("get_stats() works with nowcast == TRUE",{
skip_if_offline()
skip_on_cran()

nowcast_output <- get_stats("AGO", nowcast = TRUE)
expect_true("nowcast" %in% nowcast_output$estimate_type)
})

0 comments on commit 98676be

Please sign in to comment.