tests/testthat/test-print.R

test_that("print - formula", {
  expect_snapshot({
    mold(Species ~ Sepal.Length, iris)$blueprint
    mold(~Sepal.Length, iris)$blueprint
  })
})

test_that("print - default", {
  expect_snapshot({
    mold(iris[, c("Sepal.Length"), drop = FALSE], iris$Species)$blueprint
  })
})

test_that("print - recipe", {
  expect_snapshot({
    mold(recipes::recipe(Species ~ Sepal.Length, iris), iris)$blueprint
  })
})

Try the hardhat package in your browser

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

hardhat documentation built on June 22, 2024, 10:06 a.m.