Skip to content

Provide path for snapshot_review() hint #1577

Closed

Description

@schloerke

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
#> .....

Activity

  1. changed the title [-]Provide path for `snapshot_review()` hint[/-] [+]Provide `path` for `snapshot_review()` hint[/+] on Feb 17, 2022
  2. j-magnolia commented on Jul 12, 2022

    @j-magnolia

    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

  3. added
    feature
    on Sep 19, 2022
  4. aronatkins commented on Aug 9, 2023

    @aronatkins

    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.

  5. added a commit that references this issue on Aug 8, 2025
    2459dbd
  6. added a commit that references this issue on Aug 29, 2025
    e7e44a3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuresnapshot 📷

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions