Skip to content

Commit

Permalink
feat: Allow passing arguments to test_dir function
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakub Sobolewski committed Feb 6, 2023
1 parent bc9afdb commit b7f81ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 6 additions & 2 deletions R/tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#'
#' Uses the `{testhat}` package to run all unit tests in `tests/testthat` directory.
#'
#' @param ... Additional arguments passed to `testthat::test_dir()`.
#' @return None. This function is called for side effects.
#'
#' @examples
Expand All @@ -10,9 +11,12 @@
#' test_r()
#' }
#' @export
test_r <- function() {
test_r <- function(...) {
purge_box_cache()
testthat::test_dir(fs::path("tests", "testthat"))
testthat::test_dir(
path = fs::path("tests", "testthat"),
...
)
}

lint_dir <- function(path) {
Expand Down
5 changes: 4 additions & 1 deletion man/test_r.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b7f81ec

Please sign in to comment.