Skip to content

Commit 40645c9

Browse files
authored
fix: Cleanup print message and test from #402 (#421)
1 parent 1fcf7c9 commit 40645c9

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

R/app-driver-dir.R

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ app_set_dir <- function(
1616
) {
1717
# If the function is from the local package, ensure the package is loaded
1818
# Make a new function that first loads the package, then runs the original function
19-
message(
20-
"Upgrading `app_dir` function to load dev package: ",
21-
package_name
22-
)
2319

2420
app_fn <- app_dir
2521
app_dir <- function() {}

tests/testthat/pkgs/expkg/R/value.R

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ expkg_shiny_app <- function() {
1616
tags$p("If this app loads, it is a success!"),
1717
actionButton("btn", "Click Me"),
1818
verbatimTextOutput("btn_click_count"),
19-
verbatimTextOutput("exported_value")
19+
verbatimTextOutput("exported_value"),
20+
verbatimTextOutput("internal_value"),
21+
tags$code(expkg_internal_value)
2022
),
2123
server = function(input, output) {
2224
output$btn_click_count <- renderText({
@@ -25,6 +27,9 @@ expkg_shiny_app <- function() {
2527
output$exported_value <- renderText({
2628
expkg_exported_value
2729
})
30+
output$internal_value <- renderText({
31+
expkg_internal_value
32+
})
2833
}
2934
)
3035
}

tests/testthat/pkgs/expkg/tests/testthat/test-function.R

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@ test_that("Local pkg loads", {
99
})
1010

1111

12-
test_that("Pass in fn directly", {
12+
test_that("Pass in run fn directly", {
1313
app <- AppDriver$new(expkg_run_shiny_app)
1414
expkg_expect_shiny_app(app)
1515
})
16+
17+
18+
# https://github.com/rstudio/shinytest2/issues/296
19+
test_that("Pass in app obj fn directly", {
20+
app <- AppDriver$new(expkg_shiny_app)
21+
expkg_expect_shiny_app(app)
22+
})

0 commit comments

Comments
 (0)