vcr

knitr::opts_chunk$set(
  comment = "#>",
  collapse = TRUE,
  warning = FALSE,
  message = FALSE
)

cran checks Project Status: Active – The project has reached a stable, usable state and is being actively developed. R-check codecov rstudio mirror downloads cran version

Easier HTTP testing! Record HTTP requests and responses on disk and replay them for the unit tests of your R package, to make them independent from any connection, faster, and more complete. An R port of the Ruby gem vcr

Elevator pitch


Installation

CRAN version:

install.packages("vcr")

Development version:

remotes::install_github("ropensci/vcr")
library("vcr")
library("crul")

Docs

Check out the HTTP testing book and the vcr vignettes.

Supported HTTP libraries

Getting Started


Usage


Terminology


Workflows


How it works in lots of detail

See the vignette about internals

Just want to mock and not store on disk?

You're looking for webmockr, that vcr itself uses. webmockr only matches requests based on criteria you choose, but does not cache HTTP interactions to disk as vcr does.

Configuration


Matching/Matchers


vcr in other languages

The canonical vcr (in Ruby) lists ports in other languages at https://github.com/vcr/vcr

Note about missing features


Example packages using vcr

Contributors

Meta



ropenscilabs/vcr documentation built on Feb. 5, 2024, 5:58 p.m.