Created
December 11, 2024 08:08
-
-
Save jakubsob/02273a0b502fd20ac260bcf751eb8068 to your computer and use it in GitHub Desktop.
Run testthat tests with a filter argument as the first one and allow running in parallel using a flag
This file contains hidden or 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
.test_file <- function(file = NULL, use_parallel = FALSE) { | |
if (use_parallel) { | |
testthat::with_mocked_bindings( | |
devtools::test(filter = file), | |
find_parallel = function(...) { | |
TRUE | |
}, | |
.package = "testthat" | |
) | |
} | |
devtools::test(filter = file) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment