tests/testthat/test-stat_resid_hist.R

library(ggplot2)

mod <- lm(mpg ~ wt, mtcars)
result <- ggplot(data = mod) +
  stat_resid_hist()

test_that("is a ggplot", {
  expect_s3_class(result, class = "gg", exact = FALSE)
  expect_s3_class(result, class = "ggplot", exact = FALSE)
})
graysonwhite/gglm documentation built on April 12, 2025, 10:50 a.m.