Closed maelle closed 4 years ago
A related question, could insert_cassette()
return the cassette invisibly?
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?
Yes because the path in vcr_configure wouldn't work in both tests and from the root of the package
From https://github.com/ropensci-books/http-testing/issues/51#issuecomment-728163070
Should vcr switch back to creating a helper file instead of a setup file? Helper files in tests/testthat are no longer recommended but they are still supported and have the advantage of being loaded by
load_all()
. See https://deploy-preview-134--admiring-allen-9a00b2.netlify.app/2020/11/18/testthat-utility-belt/ Otherwise in docs about debugging one would simply recommend to source the setup file, which isn't bad either.Could vcr have a function à la testthat::test_path() that'd return the path to tests/fixtures when run in tests and when run from the root of the package? This way in the configuration there would be
where
vcr::test_path("fixtures")
is../fixtures
in tests, andtests/fixtures
otherwise.insert_cassette()
? Because if you are debugging the code in a test you might prefer usinginsert_cassette()
instead ofuse_cassette()
, as it allows more interactive debugging (you can run the code in the test, add a line, see retrying happening whereas testthat hides messages, etc)