tests/testthat/setup-chromote.R

# setup for testing with chromote
# https://github.com/rstudio/shinytest2/blob/main/tests/testthat/setup-disable-crashpad.R

# disable crash reporting
chromote::set_chrome_args(c(
  "--disable-crash-reporter",
  chromote::default_chrome_args()
))

# make sure the temp folder is removed when testing is complete
withr::defer({
  ## close the browser
  try(chromote::default_chromote_object()$get_browser()$close())

  ## clean up chromote sessions
  gc()
  Sys.sleep(2)

  ## delete the Crashpad folder if it exists
  unlink(file.path(tempdir(), "Crashpad"), recursive = TRUE)
}, envir = testthat::teardown_env())

Try the wdpar package in your browser

Any scripts or data that you put into this service are public.

wdpar documentation built on Oct. 7, 2024, 9:07 a.m.