For the record, the goal of this internal function is to create tiny toy data for tests, but we're not forced to use it so in the meantime we can use something like this:
Alternatively you may define a potential solution in tests/testthat/helper.R
devtools::load_all()
#> ℹ Loading tiltIndicator
# tests/testthat/helper.R
FIXME_example_scenarios <- function(...) {
example_scenarios(...) |>
mutate(reductions = as.double(reductions))
}
# You can now use it in any test. For example
FIXME_example_scenarios(!!aka("xsector") := c("total", "unmatched"))
#> # A tibble: 2 × 6
#> sector subsector year reductions type scenario
#> <chr> <chr> <chr> <dbl> <chr> <chr>
#> 1 total energy 2050 1 ipr a
#> 2 unmatched energy 2050 1 ipr a
Expected a double but got a character:
Thanks @kalashsinghal
For the record, the goal of this internal function is to create tiny toy data for tests, but we're not forced to use it so in the meantime we can use something like this:
Alternatively you may define a potential solution in tests/testthat/helper.R
Created on 2024-02-16 with reprex v2.1.0