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 May 29, 2024, 2:23 a.m.