Running ‘testthat.R’ [24s/383s]
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/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(ChinAPIs)
  > 
  > test_check("ChinAPIs")
  Error: status 502
  Error: status 502
  Error: status 502
  Datasets available in the 'ChinAPIs' package:
  Datasets available in the 'ChinAPIs' package:
  [ FAIL 31 | WARN 1 | SKIP 18 | PASS 4021 ]
  
  ══ Skipped tests (18) ══════════════════════════════════════════════════════════
  • On CRAN (18): 'test-get_china_child_mortality.R:13:3',
    'test-get_china_child_mortality.R:33:3',
    'test-get_china_child_mortality.R:40:3',
    'test-get_china_child_mortality.R:47:3', 'test-get_china_energy_use.R:13:3',
    'test-get_china_energy_use.R:33:3', 'test-get_china_energy_use.R:40:3',
    'test-get_china_energy_use.R:47:3', 'test-get_china_gdp.R:13:3',
    'test-get_china_gdp.R:34:3', 'test-get_china_gdp.R:41:3',
    'test-get_china_gdp.R:48:3', 'test-get_china_gdp.R:56:3',
    'test-get_china_holidays.R:12:3', 'test-get_china_holidays.R:33:3',
    'test-get_country_info_cn.R:13:3', 'test-get_country_info_cn.R:42:3',
    'test-get_country_info_cn.R:56:3'
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure ('test-get_china_literacy_rate.R:15:3'): get_china_literacy_rate() returns valid structure and types ──
  `result` is not an S3 object
  ── Failure ('test-get_china_literacy_rate.R:18:3'): get_china_literacy_rate() returns valid structure and types ──
  Names of `result` ('') don't match 'indicator', 'country', 'year', 'value'
  ── Failure ('test-get_china_literacy_rate.R:21:3'): get_china_literacy_rate() returns valid structure and types ──
  result$indicator has type 'NULL', not 'character'.
  ── Failure ('test-get_china_literacy_rate.R:22:3'): get_china_literacy_rate() returns valid structure and types ──
  result$country has type 'NULL', not 'character'.
  ── Failure ('test-get_china_literacy_rate.R:23:3'): get_china_literacy_rate() returns valid structure and types ──
  result$year has type 'NULL', not 'integer'.
  ── Failure ('test-get_china_literacy_rate.R:24:3'): get_china_literacy_rate() returns valid structure and types ──
  is.numeric(result$value) || is.integer(result$value) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_china_literacy_rate.R:36:3'): get_china_literacy_rate() returns valid structure and types ──
  nrow(result) (`actual`) not equal to 13 (`expected`).
  
  `actual` is NULL
  `expected` is a double vector (13)
  ── Failure ('test-get_china_literacy_rate.R:39:3'): get_china_literacy_rate() returns valid structure and types ──
  any(is.na(result$value)) || any(!is.na(result$value)) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_china_population.R:15:3'): get_china_population() returns correct structure and types ──
  is.null(result) is not FALSE
  
  `actual`:   TRUE 
  `expected`: FALSE
  ── Failure ('test-get_china_population.R:18:3'): get_china_population() returns correct structure and types ──
  `result` is not an S3 object
  ── Failure ('test-get_china_population.R:22:3'): get_china_population() returns correct structure and types ──
  Names of `result` ('') don't match 'indicator', 'country', 'year', 'value', 'value_label'
  ── Failure ('test-get_china_population.R:25:3'): get_china_population() returns correct structure and types ──
  result$indicator has type 'NULL', not 'character'.
  ── Failure ('test-get_china_population.R:26:3'): get_china_population() returns correct structure and types ──
  result$country has type 'NULL', not 'character'.
  ── Failure ('test-get_china_population.R:27:3'): get_china_population() returns correct structure and types ──
  result$year has type 'NULL', not 'integer'.
  ── Failure ('test-get_china_population.R:28:3'): get_china_population() returns correct structure and types ──
  is.numeric(result$value) || is.integer(result$value) is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  ── Failure ('test-get_china_population.R:29:3'): get_china_population() returns correct structure and types ──
  result$value_label has type 'NULL', not 'character'.
  ── Failure ('test-get_china_population.R:41:3'): get_china_population() returns correct structure and types ──
  nrow(result) (`actual`) not equal to 13 (`expected`).
  
  `actual` is NULL
  `expected` is a double vector (13)
  ── Failure ('test-get_china_unemployment.R:16:3'): get_china_unemployment returns a tibble/data frame ──
  `china_unemployment_data` is not an S3 object
  ── Failure ('test-get_china_unemployment.R:17:3'): get_china_unemployment returns a tibble/data frame ──
  `china_unemployment_data` is not an S3 object
  ── Failure ('test-get_china_unemployment.R:22:3'): get_china_unemployment returns data with exactly 4 columns ──
  ncol(china_unemployment_data) (`actual`) not equal to 4 (`expected`).
  
  `actual` is NULL
  `expected` is a double vector (4)
  ── Failure ('test-get_china_unemployment.R:27:3'): get_china_unemployment returns data with exactly 13 rows ──
  nrow(china_unemployment_data) (`actual`) not equal to 13 (`expected`).
  
  `actual` is NULL
  `expected` is a double vector (13)
  ── Failure ('test-get_china_unemployment.R:32:3'): get_china_unemployment returns data with correct column names ──
  names(china_unemployment_data) (`actual`) not equal to c("indicator", "country", "year", "value") (`expected`).
  
  `actual` is NULL
  `expected` is a character vector ('indicator', 'country', 'year', 'value')
  ── Failure ('test-get_china_unemployment.R:40:3'): get_china_unemployment returns data with correct column types ──
  china_unemployment_data$indicator has type 'NULL', not 'character'.
  ── Failure ('test-get_china_unemployment.R:41:3'): get_china_unemployment returns data with correct column types ──
  china_unemployment_data$country has type 'NULL', not 'character'.
  ── Failure ('test-get_china_unemployment.R:42:3'): get_china_unemployment returns data with correct column types ──
  china_unemployment_data$year has type 'NULL', not 'integer'.
  ── Failure ('test-get_china_unemployment.R:43:3'): get_china_unemployment returns data with correct column types ──
  china_unemployment_data$value has type 'NULL', not 'double'.
  ── Failure ('test-get_china_unemployment.R:60:3'): get_china_unemployment year column covers 2010-2022 completely ──
  `actual_years` (`actual`) not equal to `expected_years` (`expected`).
  
  `actual` is NULL
  `expected` is an integer vector (2010, 2011, 2012, 2013, 2014, ...)
  ── Failure ('test-get_china_unemployment.R:65:3'): get_china_unemployment year column has no duplicate years ──
  length(unique(china_unemployment_data$year)) (`actual`) not equal to 13 (`expected`).
  
    `actual`:  0.0
  `expected`: 13.0
  ── Failure ('test-get_china_unemployment.R:94:3'): get_china_unemployment shows expected COVID-19 impact in 2020 ──
  `year_of_max` (`actual`) not equal to 2020 (`expected`).
  
  `actual` is NULL
  `expected` is a double vector (2020)
  ── Failure ('test-get_china_unemployment.R:95:3'): get_china_unemployment shows expected COVID-19 impact in 2020 ──
  `max_unemployment` (`actual`) not equal to 5 (`expected`).
  
    `actual`: -Inf
  `expected`:  5.0
  ── Error ('test-get_china_unemployment.R:105:3'): get_china_unemployment values show typical stability for China ──
  Error in `var(china_unemployment_data$value)`: 'x' is NULL
  Backtrace:
      ▆
   1. └─stats::var(china_unemployment_data$value) at test-get_china_unemployment.R:105:3
  
  [ FAIL 31 | WARN 1 | SKIP 18 | PASS 4021 ]
  Error: Test failures
  Execution halted