tests/testthat/test-knitr-helpers.R

test_that("setting options works", {
  knitr::opts_chunk$restore()
  expect_equal(knitr::opts_chunk$get("comment"), "##")

  applied <- notebook_set_opts_chunk()

  expect_equal(
    knitr::opts_chunk$get("comment"),
    applied[["comment"]]
  )

  knitr::opts_chunk$restore()
})
tjmahr/notestar documentation built on Jan. 23, 2025, 5:26 p.m.