tests/testthat/test-plotly-internals.R

# test some assumptions we make about internal functions

test_that("remove_class() can remove 'AsIs' class", {
  x <- 1:10
  class(x) <- c("x", "y")
  x <- remove_class(I(x), "AsIs")
  expect_equivalent(class(x), c("x", "y"))
})


test_that("default() doesn't change to_JSON() behavior", {
  x <- 1:10
  expect_equivalent(to_JSON(default(x)), to_JSON(x))
})

Try the plotly package in your browser

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

plotly documentation built on Nov. 10, 2022, 5:42 p.m.