You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
Could there be a vignette about debugging explaining the above and also mentioning insert_cassette()? Because if you are debugging the code in a test you might prefer using insert_cassette() instead of use_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)
The text was updated successfully, but these errors were encountered:
From ropensci-books/http-testing#51 (comment)
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)The text was updated successfully, but these errors were encountered: