Skip to content

Commit

Permalink
Use setup_shinytest2.R
Browse files Browse the repository at this point in the history
  • Loading branch information
jthompson-arcus committed Feb 14, 2025
1 parent 189f10d commit d9cc167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,5 @@ library(shiny)
library(riskassessment)
# Load application support files into testing environment
library(shinytest2)
options(shinytest2.load_timeout = 45*1000)
options(shinytest2.timeout = 45*1000)

chromote::set_chrome_args(
c(
chromote::default_chrome_args(),
"--no-sandbox"
)
)

tmpt <- Sys.time()
while (!chromote::has_default_chromote_object() && Sys.time() - tmpt < 1) {
try(chromote::set_default_chromote_object(chromote::Chromote$new()), silent = TRUE)
}

test_check("riskassessment")
# test_file("tests/testthat/test-downloadHandler.R")
16 changes: 16 additions & 0 deletions tests/testthat/setup_shinytest2.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Set options for tests to run properly
options(shinytest2.load_timeout = 45*1000)
options(shinytest2.timeout = 45*1000)
options(chromote.headless = "new")

chromote::set_chrome_args(
c(
chromote::default_chrome_args(),
"--no-sandbox"
)
)

tmpt <- Sys.time()
while (!chromote::has_default_chromote_object() && Sys.time() - tmpt < 1) {
try(chromote::set_default_chromote_object(chromote::Chromote$new()), silent = TRUE)
}

0 comments on commit d9cc167

Please # to comment.