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

FR: export testthat::snapshot_review() #2528

Closed
olivroy opened this issue Jul 14, 2023 · 2 comments
Closed

FR: export testthat::snapshot_review() #2528

olivroy opened this issue Jul 14, 2023 · 2 comments

Comments

@olivroy
Copy link
Contributor

olivroy commented Jul 14, 2023

Hi,

I was wondering if devtools could export testthat::snapshot_review()?.

It could improve the workflow a little when hyperlinks are buggy, see
rstudio/rstudio#13088, it would require less typing.

Maybe consider exporting testthat::snapshot_accept() also.

Thanks

Edit: I can contribute a PR if you think this is reasonable.

@olivroy olivroy changed the title FR: could devtools export testthat::snapshot_review() FR: export testthat::snapshot_review() Jul 14, 2023
@hadley
Copy link
Member

hadley commented Aug 2, 2023

This is the devtools package, so it's not the right place.

But these functions should already be avialable to you because by default load_all() will attach testthat.

@hadley hadley closed this as completed Aug 2, 2023
@olivroy
Copy link
Contributor Author

olivroy commented Aug 24, 2023

Oh I opened this FR in response to an issue of having clickable hyperlinks not working with the Run Tests button.
r-lib/testthat#1846

The this worfklow

  1. get a warning that a snapshot test is failing or you just restarted session.
  2. go to that test location
  3. Click the run tests button
  4. In this case, since load_all() was not run. snapshot_review()can't autocomplete. hence the need to typetestthat::snapshot_review()` by hand (because testthat is not loaded)

However, devtools is loaded in r profile per https://usethis.r-lib.org/reference/rprofile-helper.html?q=rprofi#null
hence the reasoning behind this FR

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

2 participants