testthat
testthat copied to clipboard
Provide `path` for `snapshot_review()` hint
When running a test with a default path of ./tests/testthat
, the snapshot hint makes sense:
Run `testthat::snapshot_review('app-set-inputs/')` to review changes
However, it would be nice to the have the starting location in the hint if the starting location is not ./tests/testthat
.
testthat::test_dir("a/b/c/d/tests/testthat")
#> .....
#> Run `testthat::snapshot_review('app-set-inputs/', 'a/b/c/d/tests/testthat')` to review changes
#> .....
This is especially confusing for people who are using shinytest2
, because the testthat tests on a packaged shiny app are usually run in ./inst/app/tests/testthat
We have also hit this, as we are using testthat to test R code outside of an R package, and those tests happen to live in test/R
beneath the project repository root.