ropensci / vcr

Record and replay HTTP requests
https://docs.ropensci.org/vcr
Other
77 stars 12 forks source link

Improve debugging experience #192

Closed maelle closed 4 years ago

maelle commented 4 years ago

From https://github.com/ropensci-books/http-testing/issues/51#issuecomment-728163070

library("vcr")
invisible(vcr::vcr_configure(
  dir = vcr::test_path("fixtures") # one could still choose another location
))
vcr::check_cassette_names()

where vcr::test_path("fixtures") is ../fixtures in tests, and tests/fixtures otherwise.

maelle commented 4 years ago

A related question, could insert_cassette() return the cassette invisibly?

sckott commented 4 years ago

Should vcr switch back to creating a helper file instead of a setup file

The current vcr version on cran still has helper instead of setup https://github.com/ropensci/vcr/blob/v0.5.4/R/vcr_setup.R so at least users of the cran version won't notice any change if we revert back to helper here.

I think it does make sense to go back to helper

If we go back to helper do we still need the test_path fxn?

maelle commented 4 years ago

Yes because the path in vcr_configure wouldn't work in both tests and from the root of the package