Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to test renderDT() in a MockShinySession #1131

Closed
cpsievert opened this issue Mar 15, 2024 · 0 comments · Fixed by #1132
Closed

Unable to test renderDT() in a MockShinySession #1131

cpsievert opened this issue Mar 15, 2024 · 0 comments · Fixed by #1132

Comments

@cpsievert
Copy link
Contributor

The following code generates an error when I'd expect it to print the JSON sent to the browser.

library(shiny)
library(DT)

session <- MockShinySession$new()
isolate({
  outFunc <- renderDT({
    head(mtcars)
  })
  outFunc(session, "name")
})
Error in shiny::snapshotPreprocessInput(paste0(name, "_state"), function(value) { : 
  snapshotPreprocessInput() needs a session object.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant