Skip to content

Commit 5a6fab4

Browse files
committed
Pass ... from snapshot_review() to shiny::runApp()
Fixes #1928
1 parent ef47468 commit 5a6fab4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# testthat (development version)
22

3+
* `snapshot_review()` now passes `...` on to `shiny::runApp()` (#1928).
34
* `expect_named()` now gives more informative errors (#2091).
45
* `expect_*()` functions consistently and rigorously check their inputs (#1754).
56
* `test_that()` no longer warns about the absence of `{}` since it no longer seems to be necessary.

R/snapshot-manage.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ snapshot_reject <- function(files = NULL, path = "tests/testthat") {
4444
}
4545

4646
#' @rdname snapshot_accept
47+
#' @param ... Additional arguments passed on to [shiny::runApp()].
4748
#' @export
48-
snapshot_review <- function(files = NULL, path = "tests/testthat") {
49+
snapshot_review <- function(files = NULL, path = "tests/testthat", ...) {
4950
check_installed(c("shiny", "diffviewer"), "to use snapshot_review()")
5051

5152
changed <- snapshot_meta(files, path)
@@ -54,12 +55,12 @@ snapshot_review <- function(files = NULL, path = "tests/testthat") {
5455
return(invisible())
5556
}
5657

57-
review_app(changed$name, changed$cur, changed$new)
58+
review_app(changed$name, changed$cur, changed$new, ...)
5859
rstudio_tickle()
5960
invisible()
6061
}
6162

62-
review_app <- function(name, old_path, new_path) {
63+
review_app <- function(name, old_path, new_path, ...) {
6364
stopifnot(
6465
length(name) == length(old_path),
6566
length(old_path) == length(new_path)
@@ -147,7 +148,8 @@ review_app <- function(name, old_path, new_path) {
147148
shiny::runApp(
148149
shiny::shinyApp(ui, server),
149150
quiet = TRUE,
150-
launch.browser = shiny::paneViewer()
151+
launch.browser = shiny::paneViewer(),
152+
...
151153
)
152154
invisible()
153155
}

man/snapshot_accept.Rd

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)