Repository navigation
Include test path in snaphot hints - #2191
Conversation
If you're not testing the current directory/package. Fixes #1577
|
@schloerke could you please take a look and double check that this meets your needs? |
|
Need same logic in |
|
And the base reporter hints as well, please: Lines 147 to 148 in 71a33cd |
|
@schloerke I don't think it makes sense to change that line — it is called when you're running |
Correct. Sorry for the false lead! |
|
@schloerke if the updated code doesn't help, can you please give me an example of how you're running the tests, and then I can iterate. |
|
With the latest... Two odd things:
PR: Expected: |
|
|
Where do I get shinyjster from? |
|
@schloerke I figured it out and made a bunch of fixes. Let me know how this version goes 😄 |
|
Outputs are tied directly to the test now. Thank you. CRAN -
|
|
|
||
| if (is.null(variant) || variant == "_default") { | ||
| name <- file | ||
| id <- c(file, name) |
There was a problem hiding this comment.
Q: The hint has changed from "Review the test file snapshots" to "Review this specific snapshot only", which causes work (delete the file name or many copy/paste's) to review more than one snapshot in a single test file. While the new code is accurate, it makes reviewing more time consuming.
I'd advocate for still returning the variant name for review.
Expected:
testthat::snapshot_review("mytest/", "inst/apps/001-hello/tests/testthat")
Not:testthat::snapshot_review("mytest/002.png", "inst/apps/001-hello/tests/testthat")
| id <- c(file, name) | |
| id <- file |
Or would it be possible to have the final comments suggest to review the test file's snaps.
There was a problem hiding this comment.
Ooooooh, I did wonder about that, but I thought that was the existing behaviour too. I removed the variant because it didn't work, but I think that's because it doesn't work when both file and variant are supplied.
(There's something about the code paths here that I find extremely confusing.)
If you're not testing the current directory/package.
Fixes #1577