-
-
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
Documentation for Interactive Snapshot Update #5291
Documentation for Interactive Snapshot Update #5291
Conversation
I could not find in the docs a section where the watch mode is describe. Should it be created? |
Codecov Report
@@ Coverage Diff @@
## master #5291 +/- ##
=======================================
Coverage 61.32% 61.32%
=======================================
Files 205 205
Lines 6909 6909
Branches 3 3
=======================================
Hits 4237 4237
Misses 2671 2671
Partials 1 1 Continue to review full report at Codecov.
|
I think a separate section for the watch mode would be awesome. Especially now that it's pluggable and people can create their own |
I think the changelog is unnecessary now @genintho since it has already landed in the current version If creating the whole watch mode doc is too much to get this off the ground, you could consider adding interactive snapshot testing to the snapshots doc after the Updating Snapshots section Something like this (which we can move to the Watch Mode page once it exists): Interactive UpdatesSnapshots can also be updated one at a time in the Jest watch mode: [screenshot highlighting watch menu option "i"] Once you enter the Interactive Snapshot Updates mode, Jest will walk you though the failed snapshots one at a time and give you an opportunity to review the failed output. From here you can choose to update that snapshot or skip to the next: [gif of updating and skipping] |
I disagree with this. Not everybody update their libraries constantly and having the ability to read all the things that change in an efficient format is really valuable. |
Sorry, I was wrong. I thought I saw this in the Changelog in the last update I made We agree that it should be there, my mistake 😄 |
How about 1 screenshot and 1 gif? 😃 This is looking really nice! |
docs/SnapshotTesting.md
Outdated
@@ -121,6 +121,20 @@ You can try out this functionality by cloning the | |||
[snapshot example](https://github.com/facebook/jest/tree/master/examples/snapshot), | |||
modifying the `Link` component, and running Jest. | |||
|
|||
#### Interactive Updates | |||
|
|||
Snapshots can also be updated one at a time in the Jest watch mode: |
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.
This is not entirely true, as interaction with snapshots happens test file by test file, not test by test. Can you fix the description to be more accurate (including the paragraph below)?
We'd like to avoid issues about this feature not working as expected (but we'll get there eventually)
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.
@thymikee good catch, this is my bad as it's in my copy above
Related to this, the skip option still says "Press s to skip the current snapshot"
…ive-mode Conflicts: CHANGELOG.md
Updated. |
CHANGELOG.md
Outdated
@@ -34,6 +34,8 @@ | |||
not generate additional (invalid) paths by prepending each ancestor of `cwd` | |||
to the absolute path. Additionally, this fixes functionality in Windows OS. | |||
([#5398](https://github.com/facebook/jest/pull/5398)) | |||
* `[doc]` Add information about Interactive Snapshot update |
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.
nit - this is [docs]
everywhere else
docs/SnapshotTesting.md
Outdated
![](/jest/img/content/interactiveSnapshot.png) | ||
|
||
Once you enter the Interactive Snapshot Updates mode, Jest will walk you though | ||
the failed snapshots of one test file at a time and give you an opportunity to |
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 think there's an extra "of" here - should be:
Jest will walk you through the failed snapshots one test file at a time...
Also though
is a typo, should be through
updated again. Finger cross! |
small bump 😄 |
@rickhanlonii mind making sure this lands? @genintho could you try a rebase on master? If we're lucky it'll fix CI |
Rebased twice, and the tests are still broken with the same circle CI internal error. |
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.
LGTM, I made a few minor wording updates
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. |
Update the documentation and the changelog for #3831 (review)
Fixes #5288