Skip to content

Commit f1d1eda

Browse files
committed
add a test for an app with errors
1 parent 364bcce commit f1d1eda

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/manual/7-errors.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
library(shiny)
2+
3+
ui <- fluidPage(
4+
selectInput("case", NULL, c("success", "error", "validate")),
5+
withSpinner(plotOutput("plot"))
6+
)
7+
server <- function(input, output) {
8+
output$plot <- renderPlot({
9+
Sys.sleep(1)
10+
validate(need(input$case != "validate", "Validation error"))
11+
if (input$case == "error") {
12+
stop("error")
13+
}
14+
plot(runif(10))
15+
})
16+
}
17+
shinyApp(ui, server)

0 commit comments

Comments
 (0)