Running 'testthat.R' [20s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(tradestatistics)
  > 
  > test_check("tradestatistics")
  -- 1. Failure: ots_create_tidy_data connects to the API and returns an error aft
  `ots_create_tidy_data(years = 1962, reporters = "abc", partners = "cde")` threw an error with unexpected message.
  Expected match: "specified reporter returned no valid ISO code"
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
    1. testthat::expect_error(...)
    6. tradestatistics::ots_create_tidy_data(...)
   10. jsonlite::fromJSON(resp$parse(encoding = "UTF-8"))
   11. jsonlite:::parse_and_simplify(...)
   12. jsonlite:::parseJSON(txt, bigint_as_char)
   13. jsonlite:::parse_string(txt, bigint_as_char)
  
  -- 2. Failure: ots_create_tidy_data connects to the API and returns an error aft
  `ots_create_tidy_data(years = 1962, reporters = "chl", partners = "abc")` threw an error with unexpected message.
  Expected match: "specified partner returned no valid ISO code"
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
    1. testthat::expect_error(...)
    6. tradestatistics::ots_create_tidy_data(...)
   10. jsonlite::fromJSON(resp$parse(encoding = "UTF-8"))
   11. jsonlite:::parse_and_simplify(...)
   12. jsonlite:::parseJSON(txt, bigint_as_char)
   13. jsonlite:::parse_string(txt, bigint_as_char)
  
  -- 3. Failure: ots_create_tidy_data connects to the API and returns an error aft
  `ots_create_tidy_data(years = 1776, reporters = "usa", partners = "all")` threw an error with unexpected message.
  Expected match: "years exposed in api.tradestatistics.io/year_range."
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
    1. testthat::expect_error(...)
    6. tradestatistics::ots_create_tidy_data(...)
   10. jsonlite::fromJSON(resp$parse(encoding = "UTF-8"))
   11. jsonlite:::parse_and_simplify(...)
   12. jsonlite:::parseJSON(txt, bigint_as_char)
   13. jsonlite:::parse_string(txt, bigint_as_char)
  
  == testthat results  ===========================================================
  [ OK: 51 | SKIPPED: 0 | WARNINGS: 1 | FAILED: 3 ]
  1. Failure: ots_create_tidy_data connects to the API and returns an error after invalid input (@test-ots_create_tidy_data.R#52) 
  2. Failure: ots_create_tidy_data connects to the API and returns an error after invalid input (@test-ots_create_tidy_data.R#58) 
  3. Failure: ots_create_tidy_data connects to the API and returns an error after invalid input (@test-ots_create_tidy_data.R#64) 
  
  Error: testthat unit tests failed
  Execution halted