context("test startup")
library(processx)
test_that("correct startup", {
# from here: https://www.r-bloggers.com/building-a-shiny-app-as-a-package/
# We're creating a new process that runs the app
#% print(list.files())
#% print(list.files(utildir))
skip_on_cran()
skip("Skipping during R check")
x <- process$new(
"R",
c(
"-e",
# As we are in the tests/testthat dir, we're moving
# two steps back before launching the whole package
# and we try to launch the app
"library(baseApp);launch_app()"
)
)
# We leave some time for the app to launch
# Configure this according to your need
Sys.sleep(5)
# We check that the app is alive
expect_true(x$is_alive())
# We kill it
x$kill()
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.