Skip to content

Commit ea216ad

Browse files
committed
test: add vdiffr snapshots for gg_variable RF classification (PR #87)
1 parent 0cd84ae commit ea216ad

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/testthat/test_snapshots.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,27 @@ local({
274274
})
275275
}
276276

277+
## ── randomForest classification snapshots (PR #87) ───────────────────────────
278+
if (requireNamespace("randomForest", quietly = TRUE)) {
279+
local({
280+
set.seed(42L)
281+
rf_iris <- randomForest::randomForest(Species ~ ., data = iris, ntree = 50L)
282+
gg_iris <- gg_variable(rf_iris)
283+
284+
test_that("snapshot: gg-variable-rf-classification-default", {
285+
vdiffr::expect_doppelganger(
286+
"gg-variable-rf-classification-default",
287+
plot(gg_iris)
288+
)
289+
})
290+
291+
test_that("snapshot: gg-variable-rf-classification-smooth", {
292+
vdiffr::expect_doppelganger(
293+
"gg-variable-rf-classification-smooth",
294+
plot(gg_iris, xvar = "Sepal.Length", smooth = TRUE)
295+
)
296+
})
297+
})
298+
}
299+
277300
} # end CI guard

0 commit comments

Comments
 (0)