rstudio / shinytest

Automated testing for shiny apps
https://rstudio.github.io/shinytest/
Other
225 stars 55 forks source link

Leverage shinyAppDir()'s new exception class for more accurate error messages #375

Closed cpsievert closed 3 years ago

cpsievert commented 3 years ago

(Builds on https://github.com/rstudio/shiny/pull/3229)

Due to recent changes, running testApp() on a directory with a app.R/server.R file (which throws an error) now throws with an incorrect, and very confusing, error:

> shinytest::testApp()
Error: `appDir` doesn't contain 'app.R', 'server.R', or exactly one '.Rmd'

For example, suppose I have a ./app.R file that simply contains:

stop("boom")

With this fix, you'll now get the same error that you'd get if you were to do shiny::runApp()

> shinytest::testApp()
Error in value[[3L]](cond) : boom
cpsievert commented 3 years ago

(Re-running the jobs 0a36150 now that rstudio/shiny#3228 is merged)