-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
API mocking would be useful for the following:
- Reduce the number of API calls during testing of non-mutating interactions and enable periodic update of mocking as needed
- Run vignettes using mocking to avoid authentication and the need to keep resources online making them easier to maintain as the R package changes
- Enabling the tests to run in CRAN so that the package can be submitted to CRAN. Alternatively we could disable testing in CRAN for tests that use the API/internet.
- Potentially use also in the Roxygen examples
The space has grown considerably with the following useful packages:
- vcr (httr and httr2 supported
- httptest (for httr) or httptest2 (for httr2)
- webmockr
This is a good introduction to API mocking in R: https://books.ropensci.org/http-testing/index.html