Running ‘testthat.R’ [0m/13m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(rbcb)
  > 
  > test_check("rbcb")
  ── 1. Error: it should get one series as data.frame (@test-get_series.R#11)  ───
  lexical error: invalid char in json text.
                                         <p>iisnode encountered an error
                       (right here) ------^
  1: get_series(1, last = 10) at testthat/test-get_series.R:11
  2: mapply(create_series, series, objs, MoreArgs = list(as = as), SIMPLIFY = FALSE, USE.NAMES = FALSE)
  3: (function (json_, x, as) 
     {
         if (as == "text") 
             return(json_)
         df_ <- jsonlite::fromJSON(json_)
         names(df_) <- resolve_names(names(df_))
         df_ = within(df_, {
             date <- as.Date(date, format = "%d/%m/%Y")
             if (exists("end_date")) 
                 end_date <- as.Date(end_date, format = "%d/%m/%Y")
             value <- as.numeric(value)
         })
         name_ <- x$name
         switch(as, tibble = {
             df_ <- tibble::as_tibble(df_)
             names(df_) <- set_series_name(names(df_), name_)
             df_
         }, data.frame = {
             names(df_) <- set_series_name(names(df_), name_)
             df_
         }, xts = {
             df_ <- xts::xts(df_$value, df_$date)
             names(df_) <- name_
             df_
         }, ts = {
             freq = if (is.null(x$info$frequency)) "D" else x$info$frequency
             freq_ = switch(freq, A = 1, M = 12, D = 366)
             start = switch(freq, A = {
                 as.integer(format(df_$date[1], "%Y"))
             }, M = {
                 c(as.integer(format(df_$date[1], "%Y")), as.integer(format(df_$date[1], 
                     "%m")))
             }, D = {
                 c(as.integer(format(df_$date[1], "%Y")), as.integer(format(df_$date[1], 
                     "%j")))
             })
             stats::ts(df_$value, start = start, frequency = freq_)
         })
     })(dots[[1L]][[1L]], dots[[2L]][[1L]], as = "tibble")
  4: jsonlite::fromJSON(json_)
  5: fromJSON_string(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  6: parseJSON(txt, bigint_as_char)
  7: parse_string(txt, bigint_as_char)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 46 SKIPPED: 0 FAILED: 1
  1. Error: it should get one series as data.frame (@test-get_series.R#11) 
  
  Error: testthat unit tests failed
  Execution halted