-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use snapshot tests #538
Use snapshot tests #538
Conversation
not using `expect_no_condition()` due to a dplyr condition coming through
in hopes that this move the loading of purrr to somewhere else and R CMD check hard passes
Any suggestions to solve #539 welcome! I think I'll start with making tests self-contained because looks like it's about when purrr is loaded and I think I recall a comment about code in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome—will defer to your judgment on which snaps deserve attention. :) Just a couple Find + Replace Wonk suggestions.
This PR helped me deal with my feelings about:
expect_snapshot(error = TRUE, {
int_pctl(bt_small, id)
})
vs.
expect_snapshot(error = TRUE, int_pctl(bt_small, id))
vs.
expect_snapshot(
error = TRUE,
int_pctl(bt_small, id)
)
So thank you for that😝
Co-authored-by: Simon P. Couch <[email protected]>
Thanks for catching the indentation bits! 🙌 |
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
This PR moves tests around errors and warnings to our current standard:
expect_error(regexp = NA)
is nowexpect_no_error()
(and notexpect_no_condition()
due to a<dplyr_regroup>
condition like inexpect_error(regexp = NA)
->expect_no_condition()
parsnip#1188 (comment))expect_error()
otherwise is nowexpect_snapshot(error = TRUE)
expect_warning()
is nowexpect_snapshot()
expect_snapshot_error()
andexpect_snapshot_warning()
are nowexpect_snapshot()
(with and withouterror = TRUE
, respectively) to add the context to the snapshotI didn't see any
expect_message()
orexpect_condition()
.I'll open separate issues for anything in the snapshots that needs fixing after we merge this because then I can link to the snapshot more easily.