Skip to content

include input values in snapshot for a smooth review #28

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

Merged
merged 1 commit into from
May 12, 2023

Conversation

6293
Copy link
Contributor

@6293 6293 commented May 12, 2023

No description provided.

@6293 6293 requested a review from a team as a code owner May 12, 2023 06:35
@6293 6293 mentioned this pull request May 12, 2023
@untitaker
Copy link
Member

I would use this instead: https://insta.rs/docs/advanced/#custom-descriptions-and-infos

@6293 6293 force-pushed the input-in-snapshot branch from 3dae85b to df48390 Compare May 12, 2023 14:31
@6293
Copy link
Contributor Author

6293 commented May 12, 2023

ty

@untitaker
Copy link
Member

I believe that if you use description instead of info, the input data appears in cargo insta review but does not require you to have that data in the snapshot. That's what I was trying to achieve. But I also can see the value in having input/output appear next to each other in PR diffs. So I'm going to merge this anyway

@untitaker untitaker merged commit 5d27055 into getsentry:main May 12, 2023
@6293
Copy link
Contributor Author

6293 commented May 12, 2023

info also appears in the review session:

Reviewing [1/3] json-schema-diff@0.1.5:
Snapshot file: tests/snapshots/test__from_fixtures@additional_properties__restrict.json.snap
Snapshot: from_fixtures@additional_properties__restrict
Source: tests/test.rs:12
Input file: tests/fixtures/additional_properties/restrict.json
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Expression: diff
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
lhs:
  additionalProperties: true
rhs:
  additionalProperties: false
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
-old snapshot
+new results
────────────┬───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
    0     0 │ [
    1     1 │     Change {
    2       │-        path: ".<additionalProperties>",;
          2 │+        path: ".<additionalProperties>",
    3     3 │         change: TypeRemove {
    4     4 │             removed: String,
    5     5 │         },
    6     6 │     },
────────────┴───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

  a accept     keep the new snapshot
  r reject     keep the old snapshot
  s skip       keep both for now
  i hide info  toggles extended snapshot info
  d hide diff  toggle snapshot diff

@untitaker
Copy link
Member

yup that's fine, i was mostly focused on how to get it out of the snapshot files, but there is value in having the input data there

@6293
Copy link
Contributor Author

6293 commented May 12, 2023

ah I didn't read the whole sentences well! Thank you for the clarification

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

Successfully merging this pull request may close these issues.

2 participants