Running 'testthat.R' [15s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(newsanchor)
  > library(askpass)
  > test_check("newsanchor")
  [ FAIL 3 | WARN 0 | SKIP 10 | PASS 20 ]
  
  ══ Skipped tests (10) ══════════════════════════════════════════════════════════
  • NEWS_API_TEST_KEY not available in environment. Skipping test. (10):
    'test_get_everything.R:95:3', 'test_get_everything.R:104:3',
    'test_get_everything.R:114:3', 'test_get_headlines.R:54:3',
    'test_get_headlines.R:62:3', 'test_get_headlines.R:72:3',
    'test_get_headlines.R:86:3', 'test_get_sources.R:30:3',
    'test_get_sources.R:40:3', 'test_get_sources.R:50:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_get_everything.R:88:3'): test that function raises warning if API key invalid. ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [newsapi.org] Resolving timed out after 10015 milliseconds
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_get_everything.R:88:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─newsanchor::get_everything(api_key = "thisisnotanapikey", query = "sports")
    7.   └─newsanchor:::make_newsanchor_get_request(url = url, api_key = api_key)
    8.     └─httr::GET(url, httr::add_headers(`X-Api-Key` = api_key))
    9.       └─httr:::request_perform(req, hu$handle$handle)
   10.         ├─httr:::request_fetch(req$output, req$url, handle)
   11.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   12.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_headlines.R:47:3'): test that function raises warning if API key invalid. ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: newsapi.org
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_get_headlines.R:47:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─newsanchor::get_headlines(api_key = "thisisnotanapikey", query = "sports")
    7.   └─newsanchor:::make_newsanchor_get_request(url = url, api_key = api_key)
    8.     └─httr::GET(url, httr::add_headers(`X-Api-Key` = api_key))
    9.       └─httr:::request_perform(req, hu$handle$handle)
   10.         ├─httr:::request_fetch(req$output, req$url, handle)
   11.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   12.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error ('test_get_sources.R:24:3'): that that function raises warning if invalid API key is specified. ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Could not resolve host: newsapi.org
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_get_sources.R:24:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat (local) .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─newsanchor::get_sources(api_key = "thisisnotanapikey")
    7.   └─newsanchor:::make_newsanchor_get_request(url, api_key)
    8.     └─httr::GET(url, httr::add_headers(`X-Api-Key` = api_key))
    9.       └─httr:::request_perform(req, hu$handle$handle)
   10.         ├─httr:::request_fetch(req$output, req$url, handle)
   11.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   12.           └─curl::curl_fetch_memory(url, handle = handle)
  
  [ FAIL 3 | WARN 0 | SKIP 10 | PASS 20 ]
  Error: Test failures
  Execution halted