test: Add autogenerated tests to prepare for a refactor PR#1092
Merged
danieljbruce merged 8 commits intogoogleapis:mainfrom Jun 17, 2022
Merged
test: Add autogenerated tests to prepare for a refactor PR#1092danieljbruce merged 8 commits intogoogleapis:mainfrom
danieljbruce merged 8 commits intogoogleapis:mainfrom
Conversation
bcoe
approved these changes
Jun 3, 2022
bcoe
left a comment
There was a problem hiding this comment.
This seems like a great use of snapshots, I left one suggestion that I think will make maintenance easier.
| "pack-n-play": "^1.0.0-2", | ||
| "proxyquire": "^2.0.0", | ||
| "sinon": "^14.0.0", | ||
| "snap-shot-it": "^7.9.1", |
There was a problem hiding this comment.
I would add an additional npm script that allows you to take snapshots retake snapshots, otherwise if the structure of responses changes in the future someone needs to read the docs for snap-shot-it, something like:
{"scripts: {
"test:snap": "COMMAND TO TAKE SNAPSHOT"
}}
danieljbruce
commented
Jun 13, 2022
Contributor
Author
danieljbruce
left a comment
There was a problem hiding this comment.
First PR follow-up
| "pack-n-play": "^1.0.0-2", | ||
| "proxyquire": "^2.0.0", | ||
| "sinon": "^14.0.0", | ||
| "snap-shot-it": "^7.9.1", |
kolea2
approved these changes
Jun 17, 2022
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.
The only thing this PR does is add tests with automatically generated snapshots that capture the data that will be sent to the generated layer. There should be no functionality changes to code in the
srcfolder.The main reason for creating these autogenerated snapshots is that next I will open a technical debt PR which refactors code and we want to be sure that when we do that refactor, we don't actually change what the code does. Comparing variable values to these previously generated snapshots will allow us to do this to ensure data being passed to the generated layer remains unchanged. If there are subtle changes then we will see the difference in the snapshot in the tech debt PR and we can check with team members that manage code server side to ensure the changes won't break anything.