Skip to content

Commit

Permalink
add helper function to mask testthat::test_path until bug fix is merg…
Browse files Browse the repository at this point in the history
…ed into testhat
  • Loading branch information
RobLBaker committed Aug 20, 2024
1 parent c659081 commit 66c2d52
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/helper.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test_path <- function(...) {
# testthat::test_path() returns incorrect value
# when in the context of devtools::test_coverage_active_file()
path <- file.path(...)
if (file.exists(path)) {
path
} else {
file.path("tests/testthat/", path)
}
}

0 comments on commit 66c2d52

Please sign in to comment.