tests/testthat/test-code_book.R

test_that("code_book() runs without error on a simple data frame", {
  skip_if_not_installed("DT")

  df <- head(mtcars)

  expect_silent({
    cb <- suppressMessages(code_book(df))
  })

  expect_s3_class(cb, "datatables")
  expect_true(inherits(cb, "htmlwidget"))
})

Try the spicy package in your browser

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

spicy documentation built on March 14, 2026, 5:06 p.m.