I've started to develop a wrapper package for an API that I don't believe has an R wrapper yet. I've got the Auth working and can retrieve data using the wonderful httr package. Where I am coming unstuck is how to approach the testing. I've seen the vignette for managing secrets however I can't get my head around how to apply this in my particular case.
The API only authorises tokens for 30 mins at which point you need to re-authenticate which requires an interactive approval of the login. At this point I can't create a token that can be refreshed without clicking to approve access.
Any thoughts on how to get around this would be super helpful.
For those interested to understand the API documentation it can be found here
httptest and vcr both look like great comprehensive options. A more lightweight option I used is Kirill Müller's mockr::with_mock, which is a replacement for the sort-of deprecated (missing from the index, at least) testthat::with_mock.