tidymodels / tidymodels/rsample
Test error class rather than snapshot for errors from other packages
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 343
- Forks
- 67
- Avg merge
- 1h 9m
- Merged PRs (30d)
- 2
Description
This looks like we are testing errors from tidyselect in various places. Example:
https://github.com/tidymodels/rsample/blob/bdf12e17d0e2f09b7da195fc7110bc1d16d15a22/tests/testthat/_snaps/boot.md?plain=1#L17-L22
If so, we should test the error class rather than the message, like here:
https://github.com/tidymodels/rsample/blob/bdf12e17d0e2f09b7da195fc7110bc1d16d15a22/tests/testthat/test-compat-vctrs.R#L67
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the tidyselect-related snapshot example in tests/testthat/_snaps/boot.md and the error-class assertion in tests/testthat/test-compat-vctrs.R. Identify the other tests that snapshot errors from tidyselect, then update them so completion is verified by error class rather than message text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- testing
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100