rOpenSci | Testing an API wrapper with webmockr and vcr
Reported on: Jun 9, 2020

Testing an API wrapper with webmockr and vcr

English • By Dave Parr • Featuring: webmockr, vcr, HTTP testing book

rOpenSci package or resource used*

webmockr and vcr with the HTTP testing book. A question on rOpenSci discourse helped me discover the tools.

What did you do?

I tested the dev.to api wrapper I wrote. I used webmockr to create stubs to the apis, and vcr to record the API response to a local disk for testing purposes. I wrote it up here.

URL or code snippet for your use case*

My code is on GitHub

Sector

Hobby

Field(s) of application

Data exchange