Skip to content
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

Test error class rather than snapshot for errors from other packages #542

Open
hfrick opened this issue Sep 19, 2024 · 1 comment
Open

Comments

@hfrick
Copy link
Member

hfrick commented Sep 19, 2024

This looks like we are testing errors from tidyselect in various places. Example:

Code
bootstraps(warpbreaks, strata = warpbreaks$tension)
Condition
Error in `bootstraps()`:
! Can't select columns that don't exist.
x Columns `L`, `L`, `L`, `L`, `L`, etc. don't exist.

If so, we should test the error class rather than the message, like here:

expect_error(vec_cast(x, x), class = "vctrs_error_incompatible_type")

@hfrick
Copy link
Member Author

hfrick commented Sep 19, 2024

link to tidyselect: #413

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant