Open jonthegeek opened 12 months ago
To officially log it: someone mentioned they saw the same behavior on mac, so it isn't a windows-only thing. Could be related to mocking and/or snapshots.
I am getting the same error message when developing a toy package on macOS.
> test_coverage()
ℹ Computing test coverage for packageA
Error in -stats$Relevant : invalid argument to unary operator
Backtrace:
▆
1. └─devtools::test_coverage()
2. └─covr::report(coverage)
3. └─covr:::to_report_data(x)
4. └─covr:::sort_file_stats(res$file_stats)
5. └─base::order(as.numeric(sub("%", "", stats$Coverage)), -stats$Relevant)
In today's workshop, I made the minimal package available here.
When I check coverage, I get this error:
I found that it's specifically here:
If I add a line to check_installed.R above the definition of the function (ie, an irrelevant line), coverage has length 3. This is probably low priority since it goes away as soon as I do something real, but it was weird.