tests/testthat/helper-html.R

show_raw_html <- function(x) {
  cat(format(x))
}

expect_snapshot_html <- function(x, .envir = parent.frame()) {
  with_private_seed()
  x_str <- deparse1(substitute(x))
  code <- parse(text = sprintf("expect_snapshot(show_raw_html(%s))", x_str))
  eval(code, envir = .envir)
}

Try the bslib package in your browser

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

bslib documentation built on May 16, 2026, 9:06 a.m.