Running 'testthat.R' [3s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(dhis2r)
  > 
  > test_check("dhis2r")
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 2 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-connect.R:16:3'): user information is a charater vector ────────
  Error in `resp_body_json(reponse, simplifyVector = TRUE)`: Unexpected content type "text/html".
  • Expecting type "application/json" or suffix "json".
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-connect.R:16:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─dhis2_play_connection$get_user_info()
   5.   └─httr2::resp_body_json(reponse, simplifyVector = TRUE)
   6.     └─httr2::resp_check_content_type(...)
   7.       └─httr2:::check_content_type(...)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  ── Error ('test-connect.R:21:3'): Resource(s) "displayName","singular","plural","href" are return ──
  Error in `resp_body_json(reponse, simplifyVector = TRUE)`: Unexpected content type "text/html".
  • Expecting type "application/json" or suffix "json".
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-connect.R:21:3
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─dhis2_play_connection$get_metadata()
   5.   └─httr2::resp_body_json(reponse, simplifyVector = TRUE)
   6.     └─httr2::resp_check_content_type(...)
   7.       └─httr2:::check_content_type(...)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  ── Error ('test-connect.R:26:3'): Type of result of a specific resouce is list ──
  Error in `resp_body_json(reponse, simplifyVector = TRUE)`: Unexpected content type "text/html".
  • Expecting type "application/json" or suffix "json".
  Backtrace:
      ▆
   1. ├─testthat::expect_type(...) at test-connect.R:26:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─dhis2_play_connection$get_metadata(endpoint = "dataElements")
   5.   └─httr2::resp_body_json(reponse, simplifyVector = TRUE)
   6.     └─httr2::resp_check_content_type(...)
   7.       └─httr2:::check_content_type(...)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  ── Error ('test-connect.R:32:3'): Type of result of possible fields is a character vector ──
  Error in `resp_body_json(reponse, simplifyVector = TRUE)`: Unexpected content type "text/html".
  • Expecting type "application/json" or suffix "json".
  Backtrace:
      ▆
   1. ├─testthat::expect_type(...) at test-connect.R:32:3
   2. │ └─testthat::quasi_label(enquo(object), arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─dhis2_play_connection$get_metadata_fields(endpoint = "dataElements")
   5.   └─httr2::resp_body_json(reponse, simplifyVector = TRUE)
   6.     └─httr2::resp_check_content_type(...)
   7.       └─httr2:::check_content_type(...)
   8.         └─cli::cli_abort(...)
   9.           └─rlang::abort(...)
  
  [ FAIL 4 | WARN 0 | SKIP 0 | PASS 2 ]
  Error: Test failures
  Execution halted