rstudio / shinytest2

https://rstudio.github.io/shinytest2/
Other
104 stars 16 forks source link

Explaining benefits/tradeoffs btw `shiny::testServer` and `shinytest2` functionality #114

Open rpodcast opened 2 years ago

rpodcast commented 2 years ago

This applies more to the documentation and/or user guides, but I had a play with migrating the tests contained in rstudio/shiny-testing-gha-example which already had some built-in testing performed via shiny::testServer. I think it would be helpful to share examples of when a developer could rely exclusively on Shiny's built-in testing methods as compared to the additional extensions shinytest2 provides. The answer is likely not an either/or situation, as there could be cases when mixing both is appropriate especially for larger apps.

schloerke commented 2 years ago

The answer is likely not an either/or situation, as there could be cases when mixing both is appropriate especially for larger apps.

Agreed!

I would like to see more of shiny::exportTestValues() usage in Shiny applications to pair with {shinytest2}'s app$expect_values(export = c("foo", "bar", "baz")).

But there is a use case to use the mock server provided in shiny::testServer() to avoid spinning up a whole app or perform wholistic testing.