From 3021524bf2d97b9e4c271cee2898a181d2580ad6 Mon Sep 17 00:00:00 2001 From: Jakub Sobolewski Date: Fri, 3 Feb 2023 14:21:33 +0100 Subject: [PATCH] feat: Allow passing arguments to test_dir function --- R/tools.R | 8 ++++++-- man/test_r.Rd | 5 ++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/R/tools.R b/R/tools.R index 53baf8b4..8bf19f4d 100644 --- a/R/tools.R +++ b/R/tools.R @@ -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 @@ -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) { diff --git a/man/test_r.Rd b/man/test_r.Rd index f9583f02..985015eb 100644 --- a/man/test_r.Rd +++ b/man/test_r.Rd @@ -4,7 +4,10 @@ \alias{test_r} \title{Run R unit tests} \usage{ -test_r() +test_r(...) +} +\arguments{ +\item{...}{Additional arguments passed to \code{testthat::test_dir()}.} } \value{ None. This function is called for side effects.