Running ‘testthat.R’ [9s/20s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/tests.html
  > # * https://testthat.r-lib.org/reference/test_package.html#special-files
  > 
  > library(testthat)
  > library(REDCapTidieR)
  > 
  > test_check("REDCapTidieR")
  [ FAIL 6 | WARN 0 | SKIP 5 | PASS 322 ]
  
  ══ Skipped tests (5) ═══════════════════════════════════════════════════════════
  • On CRAN (5): 'test-lint-free.R:2:3', 'test-read_redcap.R:1:1',
    'test-supertibble.R:1:1', 'test-utils.R:226:3', 'test-write.R:337:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-write.R:32:5'): write_redcap_xlsx without labels works ─────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `write_redcap_xlsx(supertbl, file = "supertbl_wb.xlsx", include_metadata_sheet = FALSE, include_toc_sheet = FALSE, recode_logical = FALSE)`: The package "openxlsx2" is required to write Excel files.
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-write.R:31:3
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─REDCapTidieR::write_redcap_xlsx(...) at test-write.R:32:5
   5.   └─rlang::check_installed("openxlsx2", reason = "to write Excel files.")
  ── Error ('test-write.R:70:5'): write_redcap_xlsx with labels works ────────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `write_redcap_xlsx(labelled_supertbl, add_labelled_column_headers = TRUE, file = "labelled_supertbl_wb.xlsx", include_toc_sheet = FALSE, include_metadata_sheet = FALSE, recode_logical = FALSE)`: The package "openxlsx2" is required to write Excel files.
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-write.R:69:3
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─REDCapTidieR::write_redcap_xlsx(...) at test-write.R:70:5
   5.   └─rlang::check_installed("openxlsx2", reason = "to write Excel files.")
  ── Error ('test-write.R:105:5'): write_redcap_xlsx has expected supertibble and metadata outputs ──
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `write_redcap_xlsx(supertbl, add_labelled_column_headers = FALSE, file = "default_supertbl_wb.xlsx", include_toc_sheet = TRUE, include_metadata_sheet = TRUE, recode_logical = FALSE)`: The package "openxlsx2" is required to write Excel files.
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-write.R:104:3
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─REDCapTidieR::write_redcap_xlsx(...) at test-write.R:105:5
   5.   └─rlang::check_installed("openxlsx2", reason = "to write Excel files.")
  ── Failure ('test-write.R:170:5'): write_redcap_xlsx checks work ───────────────
  Expected `.` not to throw any errors.
  Actually got a <rlib_error_package_not_found> with message:
    The package "openxlsx2" is required to write Excel files.
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-write.R:161:3
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. ├─... %>% expect_no_error() at test-write.R:170:5
   5. └─testthat::expect_no_error(.)
  ── Error ('test-write.R:309:5'): key argument checks work ──────────────────────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `write_redcap_xlsx(supertbl, file = "temp.docx")`: The package "openxlsx2" is required to write Excel files.
  Backtrace:
       ▆
    1. ├─withr::with_tempdir(...) at test-write.R:308:3
    2. │ └─withr::with_dir(tmp, code)
    3. │   └─base::force(code)
    4. ├─testthat::expect_warning(...) at test-write.R:309:5
    5. │ └─testthat:::expect_condition_matching_(...)
    6. │   └─testthat:::quasi_capture(...)
    7. │     ├─testthat (local) .capture(...)
    8. │     │ └─base::withCallingHandlers(...)
    9. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   10. └─REDCapTidieR::write_redcap_xlsx(supertbl, file = "temp.docx")
   11.   └─rlang::check_installed("openxlsx2", reason = "to write Excel files.")
  ── Error ('test-write.R:383:5'): write_redcap_xlsx handles long sheet names ────
  <rlib_error_package_not_found/rlang_error/error/condition>
  Error in `write_redcap_xlsx(long_name_supertbl, file = "long_name_supertbl_wb.xlsx", include_metadata_sheet = FALSE, include_toc_sheet = FALSE, recode_logical = FALSE)`: The package "openxlsx2" is required to write Excel files.
  Backtrace:
      ▆
   1. ├─withr::with_tempdir(...) at test-write.R:382:3
   2. │ └─withr::with_dir(tmp, code)
   3. │   └─base::force(code)
   4. └─REDCapTidieR::write_redcap_xlsx(...) at test-write.R:383:5
   5.   └─rlang::check_installed("openxlsx2", reason = "to write Excel files.")
  
  [ FAIL 6 | WARN 0 | SKIP 5 | PASS 322 ]
  Error:
  ! Test failures.
  Execution halted