tests/testthat/test-adjustment_sets.R

test_that("adjustment sets drawn correctly", {
  p <- ggdag_adjustment_set(test_dag)
  expect_doppelganger("ggdag_adjustment_set() renders", p)
})

test_that("adjustment sets drawn correctly with width set low", {
  withr::with_options(
    list(width = 20),
    {
      p <- ggdag_adjustment_set(test_dag)
      expect_doppelganger("ggdag_adjustment_set() renders with low width", p)
    }
  )
})

Try the ggdag package in your browser

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

ggdag documentation built on May 31, 2023, 7:48 p.m.