tests/testthat/test-report_error.R

message <- format_error_message()

test_that("Error report is being sent to the correct API", {

  res <- report_error(message)
  content <- httr::content(res)

  expect_true(content$error$code %in% (c("400", "403")))

})

Try the googleErrorReportingR package in your browser

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

googleErrorReportingR documentation built on Oct. 27, 2022, 5:07 p.m.