-
Notifications
You must be signed in to change notification settings - Fork 318
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
BDD it() function not reporting test coverage with test fixture #1891
Comments
Could you please create a simple reprex package? Your code here is a good start but you could make the examples even simpler, and you could assume that testthat is loaded so you don't have to preface every call with |
I also put all this information in the package README |
Hi again 😄 --I created another small example package that reproduces the issue. I kept the functions simple and only used base R to remove additional dependencies. I'm still getting 0.00% test coverage on tests using fixtures when I use |
Actually, you might want to file this in the covr package, since that's what actually does the coverage computation. |
Thank you! I will move it over 😃 |
Issue in covr (for reference) |
I noticed the new
it()
functions don't seem to load helper functions afterload_all()
.R/
folder:tests/
folder:Helper function
In
tests/testthat/helper.R
, I have the following helper:In
test-tidy_ggp2movies.R
:When the
test_logger()
helper is insideit()
(with a nesteddescribe()
):The test fails (can't find the helper).
And if I switch it to a single
describe()
function:The test still fails:
But if the helper is inside
test_that()
(with nesteddescribe()
):The test passes.
And if the helper is inside the nested
describe()
, but outsideit()
:This also passes.
I'm not sure if
test_that()
andit()
are supposed to have different functionality (or if it changes with nesteddescribe()
calls)?These
describe()
functions are great for Gherkin Features and Scenarios (and nesting is nice for combining Scenarios under Features.) :)testthat
inDESCRIPTION
:This package is here in case I'm missing something I'm not thinking of.
Thank you in advance for your time (and all your continued hard work on this package :)!)
The text was updated successfully, but these errors were encountered: