tests/testthat/test-app-detection.R

context("test Shiny app type detection")

slurp <- function(file) {
  readChar(file, file.info(file)$size, useBytes = TRUE)
}

test_that("Shiny example app detected", {
  testthat::expect_true(hasShinyJs(slurp("01_hello.html")))
})

test_that("Non-Shiny app not considered a Shiny app", {
  testthat::expect_false(hasShinyJs(slurp("r_project.html")))
})
rstudio/shinyloadtest documentation built on Jan. 21, 2023, 11:14 p.m.