-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
feat(jest-editor-snapshot): Add Snapshots metadata #4570
Conversation
Following jestjs#2629, I rebased the code on current master. I still have to actually test the feature with jest-community/vscode-jest#73. What i would like to add ultimately is the ability to: - preview the snapshot - have the snapshot diff - have a button to accept diff per snapshot (would update it) WDYT?
Codecov Report
@@ Coverage Diff @@
## master #4570 +/- ##
=========================================
- Coverage 56.16% 55.66% -0.5%
=========================================
Files 185 186 +1
Lines 6285 6345 +60
Branches 3 3
=========================================
+ Hits 3530 3532 +2
- Misses 2754 2812 +58
Partials 1 1
Continue to review full report at Codecov.
|
I don't have any feedback here, this looks really solid - great job. babel-traverse is 👍. It's worth keeping in mind the assumption that only people using babel will have these snapshots ( e.g. TypeScript users won't reliably get results ) which is fine, so the results should be considered nullable. With Babel 7 we can consolidate those code-paths in the future. |
const describeVariants = Object.assign( | ||
(Object.create(null): {[string]: boolean}), | ||
{ | ||
describe: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like it would be good to put all this in a common package with eslint-plugin-jest, because we are duplicating all of this in multiple places.
Let's do it, I think the last commits + this rebase are addressing most of the comments I have. Let's fix the remaining things as we go. I didn't realize there was a PR for vscode-jest already, looking forward to seeing it work end-to-end! Not sure how far you are willing to take this feature – are you planning to work on it beyond this initial integration of snapshots into the editor? I think there are tons more snapshot related things we could do inside the editor without starting up Jest. One of the things that would be great to have is a snapshot approval mode, where in the editor you can accept/decline updates to individual snapshots, one-by-one. |
|
^ exactly what I was looking for and willing to do so yes planning to contribute more soon enough |
* first iteration * Use babel-traverse * comments on the pr * feat(jest-editor-support): Add Snapshot metadata Following jestjs#2629, I rebased the code on current master. I still have to actually test the feature with jest-community/vscode-jest#73. What i would like to add ultimately is the ability to: - preview the snapshot - have the snapshot diff - have a button to accept diff per snapshot (would update it) WDYT?
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
Following #2629, I rebased the code on current master. I still have to
actually test the feature with jest-community/vscode-jest#73.
What i would like to add ultimately is the ability to:
Changes from #2629 to rebase on master are in ff657a0
WDYT? cc @orta @bookman25
PS: first ever contribution here, looking forward to feedback/comment/requests for change
Test plan
Same as in #2629