New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test coverage for a single file #543
Comments
I think the one tricky bit with I tried playing around with this a bit today and wasn't able the get it working with the time I allotted to the task, I think there is a bit of a chicken and egg problem with defining the test environment and instrumenting it for coverage. If you can work out a POC that uses |
devtools::test_coverage_active_file()
is proving increasingly useful in our workflow where there's (in most cases) there's a one-to-one relationship between files inR/
and intests/testthat/
. However, because covrenvironment_coverage()
callssys.source()
rather thantestthat::test_file()
we have to recreate much of thetest_file()
infrastructure intest_coverage_active_file()
. And that's fragile and continues to cause problems (see r-lib/devtools#2537 for a recent example).Could we have a variant of
environment_coverage()
(either a new argument or a new function) that'd calltestthat::test_file()
?Or maybe something like this?
The text was updated successfully, but these errors were encountered: