Running ‘testthat.R’ [29s/38s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(terrainr)
  > 
  > test_check("terrainr")
  Starting 2 test processes
  [ FAIL 2 | WARN 0 | SKIP 17 | PASS 34 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (17)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-4-merge_rasters.R:110:3): overwrite works as expected ───────────
  Error: lexical error: invalid char in json text.
                                         <!DOCTYPE html PUBLIC "-//W3C//
                       (right here) ------^
  
  Backtrace:
       ▆
    1. ├─terrainr::get_tiles(first_tile) at test-4-merge_rasters.R:110:2
    2. └─terrainr:::get_tiles.sfc(first_tile)
    3.   ├─terrainr::get_tiles(...)
    4.   └─terrainr:::get_tiles.sf(...)
    5.     └─terrainr:::get_tiles_internal(...)
    6.       └─terrainr::hit_national_map_api(...)
    7.         └─terrainr (local) get_href()
    8.           └─base::tryCatch(...)
    9.             └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   10.               └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   11.                 └─value[[3L]](cond)
   12.                   └─base::tryCatch(...)
   13.                     └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   14.                       └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   15.                         └─value[[3L]](cond)
   16.                           └─httr::content(res, type = "application/json")
   17.                             └─httr:::parse_auto(raw, type, encoding, ...)
   18.                               └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   19.                                 └─jsonlite::fromJSON(...)
   20.                                   └─jsonlite:::parse_and_simplify(...)
   21.                                     └─jsonlite:::parseJSON(txt, bigint_as_char)
   22.                                       └─jsonlite:::parse_string(txt, bigint_as_char)
  ── 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.       └─terrainr (local) get_href()
    6.         └─base::tryCatch(...)
    7.           └─base (local) tryCatchList(expr, classes, parentenv, handlers)
    8.             └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
    9.               └─value[[3L]](cond)
   10.                 └─base::tryCatch(...)
   11.                   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   12.                     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   13.                       └─value[[3L]](cond)
   14.                         └─httr::content(res, type = "application/json")
   15.                           └─httr:::parse_auto(raw, type, encoding, ...)
   16.                             └─httr (local) parser(x = content, type = type, encoding = encoding, ...)
   17.                               └─jsonlite::fromJSON(...)
   18.                                 └─jsonlite:::parse_and_simplify(...)
   19.                                   └─jsonlite:::parseJSON(txt, bigint_as_char)
   20.                                     └─jsonlite:::parse_string(txt, bigint_as_char)
  
  [ FAIL 2 | WARN 0 | SKIP 17 | PASS 34 ]
  Error: Test failures
  Execution halted