tests/testthat/test-githubApi.R

with_mock_dir("gh_api_response", {

  test_that("githubApi is class githubApi", {
    expect_equal(
      class(githubApi("repos/Rapporteket/raptools/branches", proxyUrl = "")),
      "githubApi"
    )
  })

  test_that("githubApi fun provides an error for none existing endpount", {
    expect_error(githubApi("none/existent/endpoint"), regexp = "404")
  })

})
Rapporteket/raptools documentation built on May 1, 2022, 6:42 a.m.