Testing reactivity: Initial value

  1. Without UI all inputs always start as NULL.
server <- function(input, output, session) {
 
  # Creates an reactive based on an input
  myreactive <- reactive({
    input$x * 2
  })
  
  # Updates an output
  output$txt <- renderText({
    paste0("I am ", myreactive())
  })
}

testServer(server, {
  print(input$x)
})
#> NULL