Running 'testthat.R' [13s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library("testthat")
  > library("rnrfa")
  > # library("lintr")
  > 
  > api_unavailable <- function(){
  +   resp1 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", 
  +                      query = list(format = "json-object", station = 39001,`data-type` = "gdf"), 
  +                      httr::user_agent("https://github.com/ilapros/rnrfa"))
  +   resp2 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", 
  +                      query = list(format = "json-object", station = 39001,`data-type` = "cmr"), 
  +                      httr::user_agent("https://github.com/ilapros/rnrfa"))
  +   # if any of the two streams is not working skip tests 
  +   (httr::http_error(resp1) | httr::http_error(resp2))
  + }
  > 
  > # skip_if_no_api() <- function() {
  > #   if (api_unavailable()) {
  > #     skip("API not available")
  > #   }
  > # }
  > 
  > if (!curl::has_internet()) {
  +   message("No internet, cannot run tests")
  + }else {
  +   test_check("rnrfa")
  + }
  [ FAIL 37 | WARN 0 | SKIP 1 | PASS 23 ]
  
  ══ Skipped tests (1) ═══════════════════════════════════════════════════════════
  • On Windows (1): 'test-gdf.R:32:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-catalogue.R:19:3'): Output of catalogue function is expected to be at least 1539x20 ──
  `x` not equal to `expected`.
  2 element mismatches
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-catalogue.R:19:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-catalogue.R:26:3'): Check output of catalogue for Plynlimon area ──
  `x` not equal to `expected`.
  1/1 mismatches
  [1] 0 - 9 == -9
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-catalogue.R:26:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-catalogue.R:37:3'): Check output of catalogue for minimum records of 100 years ──
  `x` not equal to `expected`.
  1 element mismatch
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-catalogue.R:37:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-catalogue.R:58:3'): Check the catalogue function filters based on column values ──
  dim(x)[1] >= 11 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-catalogue.R:61:3'): Check the catalogue function filters based on column values ──
  dim(x)[1] >= 114 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-catalogue.R:64:3'): Check the catalogue function filters based on column values ──
  dim(x)[1] >= 110 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-cmr.R:18:3'): Output of cmr function for single station ──────
  length(x) >= 660 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-cmr.R:21:3'): Output of cmr function for single station ──────
  `x` not equal to `expected`.
  1 element mismatch
  Backtrace:
      ▆
   1. └─testthat::expect_that(length(x) == 2, equals(TRUE)) at test-cmr.R:21:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-cmr.R:22:3'): Output of cmr function for single station ──────
  `x` not equal to `expected`.
  Lengths (0, 1) differ (comparison on first 0 components)
  Backtrace:
      ▆
   1. └─testthat::expect_that(...) at test-cmr.R:22:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-cmr.R:38:3'): Output of cmr function for multiple stations ───
  `x` not equal to `expected`.
  1 element mismatch
  Backtrace:
      ▆
   1. └─testthat::expect_that(length(x[[1]]) == 2, equals(TRUE)) at test-cmr.R:38:3
   2.   └─testthat (local) condition(object)
   3.     └─testthat::expect_equal(x, expected, ..., expected.label = label)
  ── Failure ('test-gdf.R:20:3'): Output of gdf function for id 18019 ────────────
  "zoo" %in% class(x1) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-gdf.R:24:3'): Output of gdf function for id 18019 ────────────
  "list" %in% class(x2) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-gdf.R:25:3'): Output of gdf function for id 18019 ────────────
  length(x2) not equal to 2.
  1/1 mismatches
  [1] 0 - 2 == -2
  ── Failure ('test-get_ts.R:32:3'): get_ts cmr single works ─────────────────────
  class(rain) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:33:3'): get_ts cmr single works ─────────────────────
  length(rain) >= 660 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:42:3'): get_ts cmr multi works ──────────────────────
  class(rain[[1]]) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:43:3'): get_ts cmr multi works ──────────────────────
  length(rain[[1]]) >= 756 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:44:3'): get_ts cmr multi works ──────────────────────
  length(rain[[2]]) >= 660 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:45:3'): get_ts cmr multi works ──────────────────────
  length(rain[[3]]) >= 660 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:53:3'): get_ts gdf single works ─────────────────────
  class(flow) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:54:3'): get_ts gdf single works ─────────────────────
  as.numeric(flow[1]) not equal to 0.056.
  Lengths differ: 0 is not 1
  ── Failure ('test-get_ts.R:55:3'): get_ts gdf single works ─────────────────────
  length(flow) >= 731 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:64:3'): get_ts gdf multi works ──────────────────────
  class(flow[[1]]) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:65:3'): get_ts gdf multi works ──────────────────────
  as.numeric(flow[[1]][1]) not equal to 0.637.
  Lengths differ: 0 is not 1
  ── Failure ('test-get_ts.R:66:3'): get_ts gdf multi works ──────────────────────
  length(flow[[1]]) >= 16855 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:67:3'): get_ts gdf multi works ──────────────────────
  as.numeric(flow[[2]][1]) not equal to 0.031.
  Lengths differ: 0 is not 1
  ── Failure ('test-get_ts.R:68:3'): get_ts gdf multi works ──────────────────────
  length(flow[[2]]) >= 13159 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:69:3'): get_ts gdf multi works ──────────────────────
  as.numeric(flow[[3]][1]) not equal to 1.262.
  Lengths differ: 0 is not 1
  ── Failure ('test-get_ts.R:70:3'): get_ts gdf multi works ──────────────────────
  length(flow[[3]]) >= 12416 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:78:3'): Check get_ts works with other types ─────────
  class(x1) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:80:3'): Check get_ts works with other types ─────────
  class(x1) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:82:3'): Check get_ts works with other types ─────────
  table(x1$rejected[1:37]) not equal to structure(...).
  names for current but not for target
  Attributes: < Component "dim": Mean absolute difference: 2 >
  Attributes: < Component "dimnames": Component "": target is NULL, current is character >
  Numeric: lengths (0, 2) differ
  ── Failure ('test-get_ts.R:88:3'): Check get_ts works with other types ─────────
  class(x2) == "zoo" is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_ts.R:89:3'): Check get_ts works with other types ─────────
  table(x2$rejected[1:11]) not equal to structure(...).
  names for current but not for target
  Attributes: < Component "dim": Mean absolute difference: 2 >
  Attributes: < Component "dimnames": Component "": target is NULL, current is character >
  Numeric: lengths (0, 2) differ
  ── Failure ('test-get_ts.R:94:3'): Check get_ts works with other types ─────────
  table(x3$rejected[1:176]) not equal to structure(...).
  names for current but not for target
  Attributes: < Component "dim": Mean absolute difference: 1 >
  Attributes: < Component "dimnames": Component "": target is NULL, current is character >
  Numeric: lengths (0, 1) differ
  ── Error ('test-seasonal_averages.R:17:3'): seasonal_averages works ────────────
  Error in `seasonal_averages(timeseries = cmr(18019), season = "Spring")`: object 'tslist' not found
  Backtrace:
      ▆
   1. └─rnrfa::seasonal_averages(timeseries = cmr(18019), season = "Spring") at test-seasonal_averages.R:17:3
  ── Failure ('test-station_ids.R:18:3'): station_ids works ──────────────────────
  length(x) >= 1580 not equal to TRUE.
  1 element mismatch
  
  [ FAIL 37 | WARN 0 | SKIP 1 | PASS 23 ]
  Error: Test failures
  Execution halted