tests/testthat/test-set-base-url.R

test_that("vw_set_base_url() works", {

  get_base_url <- function() {
    getOption("vega.embed")[["loader"]][["baseURL"]]
  }

  # set the option
  vw_set_base_url("foo")
  expect_identical(get_base_url(), "foo")

  # set the option, expect the old option, silently
  expect_identical(
    expect_silent(vw_set_base_url("bar")),
    "foo"
  )

  # set the option to NULL
  vw_set_base_url(NULL)
  expect_identical(get_base_url(), NULL)

})

Try the vegawidget package in your browser

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

vegawidget documentation built on May 29, 2024, 12:17 p.m.