tests/testthat/test-style_xaringan.R

test_that("style_xaringan() writes to specified outfile", {
  tmpfile <- tempfile(fileext = ".css")
  expect_equal(style_xaringan(outfile = tmpfile), tmpfile)
  expect_true(file.exists(tmpfile))
  expect_true(grepl("xaringanthemer", readLines(tmpfile)[3]))
})

test_that("style_xaringan() warns if base_font_size is not absolute", {
  tmpfile <- tempfile(fileext = ".css")
  expect_warning(
    style_xaringan(outfile = tmpfile, base_font_size = "1em"),
    "absolute units"
  )
})

Try the xaringanthemer package in your browser

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

xaringanthemer documentation built on Sept. 15, 2024, 5:06 p.m.