Mock HTTP Requests for API Testing
Mock HTTP Requests for API Testing
Once on CRAN, install the package as usual:
install.packages("r-lib/httrmock")
TODO
httrmock
was inspired by https://github.com/assaf/node-replay
TODO
httrmock
uses the storr
package to store the requests and responses
in RDS files, see storr::storr()
. By default the database is in the
tests/testthat
directory, which is appropriate for testthat
tests.
For an alternative directory, set the HTTRMOCK_STORE
environment
variable and point it to the directory you wish to use. The directory
will be created if it does not exist.
httrmock
uses debugme
for easy debugging of what is recorded and
replayed, see debugme::debugme()
for details.
MIT © Gábor Csárdi, RStudio
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.