Running ‘testthat.R’ [45s/81s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(terrainr)
  > 
  > test_check("terrainr")
  Starting 2 test processes
  [ FAIL 1 | WARN 0 | SKIP 24 | PASS 22 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (24)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-get_tiles.R:5:3'): SpatRast method is consistent ───────────────
  Error: lexical error: invalid char in json text.
                                         <!DOCTYPE html PUBLIC "-//W3C//
                       (right here) ------^
  
  Backtrace:
       ▆
    1. ├─terrainr::get_tiles(tmp_raster, bboxSR = 4326, imageSR = 4326) at test-get_tiles.R:5:2
    2. └─terrainr:::get_tiles.SpatRaster(tmp_raster, bboxSR = 4326, imageSR = 4326)
    3.   └─terrainr:::get_tiles_internal(...)
    4.     └─terrainr::hit_national_map_api(...)
    5.       └─base::tryCatch(...)
    6.         └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    7.           └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    8.             └─value[[3L]](cond)
    9.               └─base::tryCatch(...)
   10.                 └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   11.                   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   12.                     └─value[[3L]](cond)
   13.                       └─httr::content(res, type = "application/json")
   14.                         └─httr:::parse_auto(raw, type, encoding, ...)
   15.                           └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   16.                             └─jsonlite::fromJSON(...)
   17.                               └─jsonlite:::parse_and_simplify(...)
   18.                                 └─jsonlite:::parseJSON(txt, bigint_as_char)
   19.                                   └─jsonlite:::parse_string(txt, bigint_as_char)
  
  [ FAIL 1 | WARN 0 | SKIP 24 | PASS 22 ]
  Error: Test failures
  Execution halted