tests/testthat/setup.R

# When we're in capture mode, clear out previous captures.

if (Sys.getenv("SLACK_API_TEST_MODE") == "capture") {
  if (Sys.getenv("SLACK_API_TOKEN") == "") {
    stop(
      "No SLACK_API_TOKEN available, cannot capture results. \n",
      "Unset SLACK_API_TEST_MODE to use mock.")
  }
  unlink(test_path("slack.com"), recursive = TRUE)
}
yonicd/slackcalls documentation built on March 12, 2023, 4:38 p.m.