Skip to content

Use expect_snapshot() instead of expect_error() and expect_message() #15

@EmilHvitfeldt

Description

@EmilHvitfeldt

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)
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions