Running ‘testthat.R’ [3s/6s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(danstat)
  > 
  > test_check("danstat")
  ── 1. Error: error behavior with wrong and correct user input (@test-get_data.R#
  API did not return text/json
  Backtrace:
   1. testthat::expect_true(...)
   6. danstat:::get_valid_variable_values("folk1c", "alder")
   7. danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   8. danstat:::check_http_type(result)
  
  ── 2. Error: warning with wrong variable values (@test-get_data.R#29)  ─────────
  API did not return text/json
  Backtrace:
    1. testthat::expect_warning(get_data(table_id = "folk1c", variables = user_input_bad_values))
    6. danstat::get_data(table_id = "folk1c", variables = user_input_bad_values)
    7. danstat:::make_variable_input(table_id, variables)
    8. danstat:::check_variables_code(table_id, user_input)
    9. danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   10. danstat:::check_http_type(result)
  
  ── 3. Error: correct column names and output class (@test-get_data.R#33)  ──────
  API did not return text/json
  Backtrace:
    1. testthat::expect_equal(...)
    7. danstat::get_data(table_id = "folk1c", variables = user_input)
    8. danstat:::make_variable_input(table_id, variables)
    9. danstat:::check_variables_code(table_id, user_input)
   10. danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   11. danstat:::check_http_type(result)
  
  ── 4. Error: returns the right object class (@test-get_table_metadata.R#6)  ────
  API did not return text/json
  Backtrace:
   1. testthat::expect_is(...)
   4. danstat::get_table_metadata(table_id = "folk1a")
   5. danstat:::check_http_type(result)
  
  ── 5. Error: get_valid_variable_names returns correct values (@test-get_table_me
  API did not return text/json
  Backtrace:
   1. testthat::expect_equal(...)
   4. danstat:::get_valid_variable_values("folk1c", "køn")
   5. danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   6. danstat:::check_http_type(result)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 11 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 5 ]
  1. Error: error behavior with wrong and correct user input (@test-get_data.R#20) 
  2. Error: warning with wrong variable values (@test-get_data.R#29) 
  3. Error: correct column names and output class (@test-get_data.R#33) 
  4. Error: returns the right object class (@test-get_table_metadata.R#6) 
  5. Error: get_valid_variable_names returns correct values (@test-get_table_metadata.R#12) 
  
  Error: testthat unit tests failed
  Execution halted