tests/testthat/test-00-graphql_errors.R

test_that("is_query_error works", {
  expect_true(test_graphql_github_priv$is_query_error(test_error_fixtures$graphql_error_no_groups))
  expect_true(test_graphql_github_priv$is_query_error(test_error_fixtures$graphql_error_no_count_languages))
})

test_that("is_no_fields_query_error works", {
  expect_true(test_graphql_github_priv$is_no_fields_query_error(test_error_fixtures$graphql_error_no_groups))
  expect_true(test_graphql_github_priv$is_no_fields_query_error(test_error_fixtures$graphql_error_no_count_languages))
})

test_that("set_graphql_error_class works", {
  error_class_object <- test_graphql_github_priv$set_graphql_error_class(
    test_error_fixtures$graphql_error_no_groups
  )
  expect_true(
    all(c("graphql_error", "graphql_no_fields_error") %in% class(error_class_object))
  )
})

Try the GitStats package in your browser

Any scripts or data that you put into this service are public.

GitStats documentation built on Aug. 19, 2025, 1:14 a.m.