For testing a Shiny app, I'd like to run the server() function without actually spawning an HTTP server:
library(shiny)
input <- reactiveValues()
output <- reactiveValues()
session <- shiny:::ShinySession$new(...)
server(input, output, session)
input$control1 <- "some value"
while (...) shiny:::serviceApp()
stopifnot(output$... == "...")
My plan is to set input values and check output values. This looks like an easier approach to testing than shinytest or Selenium. Seems like I "only" need to fill in the ... .
Is this approach feasible at all, or would it involve major changes to shiny internals? I'd appreciate any pointers.