You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It might be useful to add an error = FALSE argument to expect_snapshot(). When TRUE, no error is a failure. When FALSE, error is a failure. NULL would correspond to the current behaviour (no failure either way). When non-null, presence or absence of error would be checked on CRAN even when cran = FALSE.
Activity
Verify presence/absence of error in expect_snapshot()
Verify presence/absence of error in expect_snapshot() (#1261)
lionel- commentedon Dec 16, 2020
Just a note that multiple errors can be flexibly and conveniently tested in this way:
This prints both the code and the error message in the snapshot file.
expect_snapshot()fails if an expected error does not occur.lionel- commentedon Dec 16, 2020
Easier way suggested by @hadley:
This prints the condition objects returned invisibly by
expect_error(), including the error message.Use `testthat_print()` instead of `cnd_cat()` for error snapshots