Created
January 19, 2024 16:39
-
-
Save randrescastaneda/9d69b5d02f6f20a2101348198167b763 to your computer and use it in GitHub Desktop.
Check coverage of file when `test_coverage_active_file()` does not find Rds files in tests
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alt_coverage <- function(file_name = devtools:::find_active_file() |> | |
fs::path_file(), | |
report = TRUE) { | |
rf <- fs::path("R", file_name) | |
tf <- "tests/testthat" |> | |
fs::path(paste0("test-", file_name)) | |
dd <- covr::file_coverage(source_files = rf, | |
test_files = tf) | |
if (report == TRUE) { | |
covr::report(dd) | |
} | |
dd | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment