File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
tests/testthat/pkgs/expkg Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff 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 () {}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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+ })
You can’t perform that action at this time.
0 commit comments