If you are not careful enough with the expectation in these function you might end up getting false negatives.
I would suggest you use expect_snapshot() instead.
Before
expect_error(prep(rec, training = dat), "name")
expect_message(prep(rec2, training = dat2), "[Nn]ew names")
After
expect_snapshot(
error = TRUE,
prep(rec, training = dat)
)
expect_snapshot(
prep(rec2, training = dat2)
)
If you are not careful enough with the expectation in these function you might end up getting false negatives.
I would suggest you use
expect_snapshot()instead.Before
After