The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
The aim of shinytesters
is to make it easier to test
update functions in Shiny packages when using
testthat::testServer
.
To install the latest development version of
shinytesters
, install from GitHub:
::install_github("ashbaldry/shinytesters") remotes
Add use_shiny_testers()
at the start of any test that is
using shiny::testServer
to add inputs and other relevant
arguments to the test session inputs.
test_that("When clicking apply button, checkbox becomes checked", {
use_shiny_testers()
<- function(input, output, session) {
example_server_fn observeEvent(input$apply_btn, {
updateCheckboxInput(
inputId = "result",
label = "New Label",
value = TRUE
)
})
}
::testServer(
shinyapp = example_server_fn,
expr = {
$setInputs(apply_btn = 1L)
session
expect_identical(input$result, TRUE)
expect_identical(input$result.label, "New Label")
}
) })
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.