* using log directory 'd:/Rcompile/CRANpkg/local/4.6/nettskjemar.Rcheck' * using R Under development (unstable) (2025-07-21 r88439 ucrt) * using platform: x86_64-w64-mingw32 * R was compiled by gcc.exe (GCC) 14.2.0 GNU Fortran (GCC) 14.2.0 * running under: Windows Server 2022 x64 (build 20348) * using session charset: UTF-8 * checking for file 'nettskjemar/DESCRIPTION' ... OK * checking extension type ... Package * this is package 'nettskjemar' version '1.0.2' * package encoding: UTF-8 * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking whether package 'nettskjemar' can be installed ... OK * checking installed package size ... OK * checking package directory ... OK * checking 'build' directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... [0s] OK * checking whether the package can be loaded with stated dependencies ... [0s] OK * checking whether the package can be unloaded cleanly ... [0s] OK * checking whether the namespace can be loaded with stated dependencies ... [0s] OK * checking whether the namespace can be unloaded cleanly ... [0s] OK * checking loading without being on the library search path ... [0s] OK * checking use of S3 registration ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... [3s] OK * checking Rd files ... [1s] OK * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking installed files from 'inst/doc' ... OK * checking files in 'vignettes' ... OK * checking examples ... [2s] OK * checking for unstated dependencies in 'tests' ... OK * checking tests ... [8s] ERROR Running 'spelling.R' [0s] Running 'testthat.R' [7s] Running the tests in 'tests/testthat.R' failed. Complete output: > # Load necessary libraries > library(nettskjemar) > library(testthat) > > test_check("nettskjemar") [ FAIL 16 | WARN 0 | SKIP 0 | PASS 88 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-ns-attachment.R:4:5'): ns_get_attachment saves an attachment file ── Error in `httr2::resp_body_raw(resp)`: Can't retrieve empty body. Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-attachment.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-attachment.R:4:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_attachment(attachment_id, path = temp_file) 6. ├─base::writeBin(httr2::resp_body_raw(resp), path) 7. └─httr2::resp_body_raw(resp) 8. └─cli::cli_abort("Can't retrieve empty body.") 9. └─rlang::abort(...) ── Error ('test-ns-attachment.R:18:5'): ns_list_form_attachments retrieves metadata ── Error in `split.default(x, g)`: first argument must be a vector Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-attachment.R:17:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(result <- ns_list_form_attachments(form_id)) at test-ns-attachment.R:18:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_list_form_attachments(form_id) 6. └─stats::ave(ids$submissionId, ids$submissionId, FUN = seq_along) 7. ├─base::lapply(split(x, g), FUN) 8. ├─base::split(x, g) 9. └─base::split.default(x, g) ── Error ('test-ns-attachment.R:34:5'): ns_get_form_attachments saves attachments ── Error in `split.default(x, g)`: first argument must be a vector Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-attachment.R:31:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-attachment.R:34:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_form_attachments(...) 6. └─nettskjemar::ns_list_form_attachments(form_id) 7. └─stats::ave(ids$submissionId, ids$submissionId, FUN = seq_along) 8. ├─base::lapply(split(x, g), FUN) 9. ├─base::split(x, g) 10. └─base::split.default(x, g) ── Error ('test-ns-attachment.R:52:5'): Retrieves submission attachment metadata ── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", "submission", submission_id)))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-attachment.R:51:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(result <- ns_list_submission_attachments(submission_id)) at test-ns-attachment.R:52:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_list_submission_attachments(submission_id) 6. └─nettskjemar::ns_get_submission(submission_id) 7. └─httr2::resp_body_json(...) 8. └─httr2::resp_check_content_type(...) 9. └─httr2:::check_content_type(...) 10. └─cli::cli_abort(...) 11. └─rlang::abort(...) ── Error ('test-ns-attachment.R:67:5'): ns_get_submission_attachments saves sub attch ── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", "submission", submission_id)))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-attachment.R:65:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-attachment.R:67:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_submission_attachments(...) 6. └─nettskjemar::ns_list_submission_attachments(submission_id) 7. └─nettskjemar::ns_get_submission(submission_id) 8. └─httr2::resp_body_json(...) 9. └─httr2::resp_check_content_type(...) 10. └─httr2:::check_content_type(...) 11. └─cli::cli_abort(...) 12. └─rlang::abort(...) ── Error ('test-ns-codebook.R:3:5'): fetches raw codebook correctly ──────────── Error in `httr2::resp_body_json(resp)`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-codebook.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(raw_cb <- get_raw_codebook(form_id)) at test-ns-codebook.R:3:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar:::get_raw_codebook(form_id) 6. ├─base::structure(...) 7. └─httr2::resp_body_json(resp) 8. └─httr2::resp_check_content_type(...) 9. └─httr2:::check_content_type(...) 10. └─cli::cli_abort(...) 11. └─rlang::abort(...) ── Failure ('test-ns-codebook.R:15:5'): handles invalid form_id gracefully ───── `get_raw_codebook(100)` threw an error with unexpected message. Expected match: "Not Found" Actual message: "Unexpected content type \"NA\".\n• Expecting type \"application/json\" or suffix \"json\"." Backtrace: ▆ 1. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-codebook.R:15:5 2. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 3. ├─testthat::expect_error(get_raw_codebook(100), "Not Found") 4. │ └─testthat:::quasi_capture(...) 5. │ ├─testthat (local) .capture(...) 6. │ │ └─base::withCallingHandlers(...) 7. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 8. └─nettskjemar:::get_raw_codebook(100) 9. ├─base::structure(...) 10. └─httr2::resp_body_json(resp) 11. └─httr2::resp_check_content_type(...) 12. └─httr2:::check_content_type(...) 13. └─cli::cli_abort(...) 14. └─rlang::abort(...) ── Error ('test-ns-codebook.R:24:5'): converts raw to structured ─────────────── Error in `httr2::resp_body_json(resp)`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-codebook.R:23:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(cb <- ns_get_codebook(form_id)) at test-ns-codebook.R:24:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_codebook(form_id) 6. └─nettskjemar:::get_raw_codebook(form_id = form_id) 7. ├─base::structure(...) 8. └─httr2::resp_body_json(resp) 9. └─httr2::resp_check_content_type(...) 10. └─httr2:::check_content_type(...) 11. └─cli::cli_abort(...) 12. └─rlang::abort(...) ── Error ('test-ns-codebook.R:35:5'): respects asis flag ─────────────────────── Error in `httr2::resp_body_json(resp)`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-codebook.R:34:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-codebook.R:35:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_codebook(form_id, asis = TRUE) 6. └─nettskjemar:::get_raw_codebook(form_id = form_id) 7. ├─base::structure(...) 8. └─httr2::resp_body_json(resp) 9. └─httr2::resp_check_content_type(...) 10. └─httr2:::check_content_type(...) 11. └─cli::cli_abort(...) 12. └─rlang::abort(...) ── Error ('test-ns-form.R:3:5'): test get forms list ─────────────────────────── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", "me")))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-form.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(formslist <- ns_get_forms()) at test-ns-form.R:3:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_forms() 6. └─httr2::resp_body_json(...) 7. └─httr2::resp_check_content_type(...) 8. └─httr2:::check_content_type(...) 9. └─cli::cli_abort(...) 10. └─rlang::abort(...) ── Error ('test-ns-form.R:36:5'): test get raw forms list ────────────────────── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", "me")))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-form.R:35:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(formslist_raw <- ns_get_forms(asis = TRUE)) at test-ns-form.R:36:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_forms(asis = TRUE) 6. └─httr2::resp_body_json(...) 7. └─httr2::resp_check_content_type(...) 8. └─httr2:::check_content_type(...) 9. └─cli::cli_abort(...) 10. └─rlang::abort(...) ── Error ('test-ns-me.R:3:5'): test user information ─────────────────────────── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "me")))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-me.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(me <- ns_get_me()) at test-ns-me.R:3:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_me() 6. └─httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "me"))) 7. └─httr2::resp_check_content_type(...) 8. └─httr2:::check_content_type(...) 9. └─cli::cli_abort(...) 10. └─rlang::abort(...) ── Error ('test-ns-meta.R:3:5'): ns_get_meta for valid input ─────────────────── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", form_id, "info")))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-meta.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(meta <- ns_get_meta(form_id)) at test-ns-meta.R:3:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_meta(form_id) 6. └─httr2::resp_body_json(...) 7. └─httr2::resp_check_content_type(...) 8. └─httr2:::check_content_type(...) 9. └─cli::cli_abort(...) 10. └─rlang::abort(...) ── Failure ('test-ns-meta.R:26:5'): ns_get_meta invalid form_id ──────────────── `ns_get_meta(100)` threw an error with unexpected message. Expected match: "Not Found" Actual message: "Unexpected content type \"NA\".\n• Expecting type \"application/json\" or suffix \"json\"." Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-meta.R:25:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-meta.R:26:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. ├─testthat::expect_error(ns_get_meta(100), "Not Found") 6. │ └─testthat:::quasi_capture(...) 7. │ ├─testthat (local) .capture(...) 8. │ │ └─base::withCallingHandlers(...) 9. │ └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo)) 10. └─nettskjemar::ns_get_meta(100) 11. └─httr2::resp_body_json(...) 12. └─httr2::resp_check_content_type(...) 13. └─httr2:::check_content_type(...) 14. └─cli::cli_abort(...) 15. └─rlang::abort(...) ── Error ('test-ns-submission.R:3:5'): ns_get_data retrieves data in original format ── Error in `resp_body_raw(resp)`: Can't retrieve empty body. Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-submission.R:2:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(...) at test-ns-submission.R:3:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_data(form_id, type = "original") 6. └─httr2::resp_body_string(...) 7. └─httr2::resp_body_raw(resp) 8. └─cli::cli_abort("Can't retrieve empty body.") 9. └─rlang::abort(...) ── Error ('test-ns-submission.R:16:5'): ns_get_submission retrieves individual submission ── Error in `httr2::resp_body_json(httr2::req_perform(httr2::req_url_path_append(ns_req(), "form", "submission", submission_id)))`: Unexpected content type "NA". • Expecting type "application/json" or suffix "json". Backtrace: ▆ 1. ├─vcr::use_cassette(...) at test-ns-submission.R:15:3 2. │ └─cassette$call_block(...) 3. ├─nettskjemar:::with_mocked_nettskjema_auth(result <- ns_get_submission(submission_id)) at test-ns-submission.R:16:5 4. │ └─base::force(expr) at D:\RCompile\CRANpkg\local\4.6\nettskjemar.Rcheck\tests\testthat\helpers.R:28:3 5. └─nettskjemar::ns_get_submission(submission_id) 6. └─httr2::resp_body_json(...) 7. └─httr2::resp_check_content_type(...) 8. └─httr2:::check_content_type(...) 9. └─cli::cli_abort(...) 10. └─rlang::abort(...) [ FAIL 16 | WARN 0 | SKIP 0 | PASS 88 ] Error: Test failures Execution halted * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking re-building of vignette outputs ... [12s] OK * checking PDF version of manual ... [20s] OK * checking HTML version of manual ... [4s] OK * DONE Status: 1 ERROR