tests/testthat/helper-rorcid.R

# don't run tests is token not set
if ( 
  identical(Sys.getenv("NOT_CRAN"), "true") &&
  Sys.getenv("ORCID_TOKEN", "") == ""
) {
  stop("set an ORCID_TOKEN env var before running tests", 
    call. = FALSE)
}

# set up vcr
library("vcr")
invisible(vcr::vcr_configure(
  dir = "../fixtures",
  filter_sensitive_data =
    list("<<rorcid_bearer_token>>" = Sys.getenv('ORCID_TOKEN'))
))

Try the rorcid package in your browser

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

rorcid documentation built on Jan. 21, 2021, 1:06 a.m.