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 3, 2023
1 parent 6696e81 commit 3021524
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,8 +11,11 @@
#' test_r()
#' }
#' @export
test_r <- function() {
testthat::test_dir(fs::path("tests", "testthat"))
test_r <- function(...) {
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 3021524

Please sign in to comment.