tests/testthat/test-status.R

set.seed(1234)

test_that("dags have correct status", {
  test_dag <- dagify(
    l ~ x + y,
    y ~ x,
    exposure = "x",
    outcome = "y",
    latent = "l"
  )

  p <- ggdag_status(test_dag)

  expect_doppelganger(
    "ggdag_status() `x` as exposure, `y` as outcome, and `l` as latent",
    p
  )
})
malcolmbarrett/ggdag documentation built on June 12, 2025, 10:48 p.m.