Snapshot testing 2.0#2620
Merged
Merged
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 807465f611
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
807465f to
8892220
Compare
This changes our golden snapshot testing. First of all is a rename from "golden" to "snapshot". Both are accepted terms in the industry it seems and there is some variance in popularity in different corners but overall it seems that "snapshot testing" is a much much more commonly used term, so we're merely aligning that. Second, we now always write output from snapshot tests, that is, the output they return is written to disk. This makes it very easy to inspect the result in an editor, to manually run a diff command or similar. Everything snapshot related is now placed in a snapshot directory at a project root level. snapshots/expected for the expected files (should be checked into git!) and snapshots/output for the output files that are always written (and should not be checked into git). --accept is now accepted (heh, pun) even for cached result, so despite not running the test, it updates the (cached) output as the new expected value.
8892220 to
3ba3a7c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes our golden snapshot testing. First of all is a rename from "golden" to "snapshot". Both are accepted terms in the industry it seems and there is some variance in popularity in different corners but overall it seems that "snapshot testing" is a much much more commonly used term, so we're merely aligning that.
Second, we now always write output from snapshot tests, that is, the output they return is written to disk. This makes it very easy to inspect the result in an editor, to manually run a diff command or similar.
Everything snapshot related is now placed in a snapshot directory at a project root level. snapshots/expected for the expected files (should be checked into git!) and snapshots/output for the output files that are always written (and should not be checked into git).
--accept is now accepted (heh, pun) even for cached result, so despite not running the test, it updates the (cached) output as the new expected value.