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"
  )
})
gadenbuie/xaringanthemer documentation built on Aug. 26, 2022, 12:14 p.m.