Tools to Work with the 'Splash' JavaScript Rendering Service in R
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
849B

  1. context("basic functionality")
  2. test_that("we can do something", {
  3. testthat::skip_on_cran()
  4. test_url <- "http://localhost:8050/"
  5. xpct <- function(x) {
  6. spact <- splash_active(splash_local)
  7. expect_that(spact, equals(TRUE))
  8. expect_that(length(splash_debug()), equals(7))
  9. expect_that(length(splash_version()), equals(9))
  10. expect_that(render_json(url = test_url), is_a("splash_json"))
  11. expect_that(render_jpeg(url = test_url), is_a("magick-image"))
  12. expect_that(render_png(url = test_url), is_a("magick-image"))
  13. expect_that(render_html(url = test_url), is_a("xml_document"))
  14. expect_that(render_har(url = test_url), is_a("har"))
  15. }
  16. spact <- splash_active(splash_local)
  17. if (spact) {
  18. xpct()
  19. } else {
  20. install_splash()
  21. vm <- start_splash()
  22. Sys.sleep(15)
  23. xpct()
  24. stop_splash(vm)
  25. }
  26. })