-
-
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
Interactive Snapshot Mode improvements #5864
Merged
cpojer
merged 13 commits into
jestjs:master
from
rickhanlonii:rh-interactive-improvements
Mar 26, 2018
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1825ed4
Interactive Snapshot Mode updates
rickhanlonii 2ac970b
Update docs
rickhanlonii f6c9ead
Squash images
rickhanlonii 9ce3f4b
More squashing
rickhanlonii 733c032
Update snaps
rickhanlonii 6fb9184
Move arrow to a const
rickhanlonii 7a6cd1b
Add comment
rickhanlonii 7537f58
Update GIF
rickhanlonii 170f708
Clarify cursorUp usage
rickhanlonii d525507
Update snaps
rickhanlonii daa8fcc
Update CHANGELOG
rickhanlonii 2eb3a44
Merge remote-tracking branch 'upstream/master' into rh-interactive-im…
rickhanlonii d66a2b8
Add AssertionLocation type
rickhanlonii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
298 changes: 285 additions & 13 deletions
298
packages/jest-cli/src/__tests__/__snapshots__/snapshot_interactive_mode.test.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,308 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`SnapshotInteractiveMode updateWithResults last test success, trigger end of interactive mode 1`] = `"TEST RESULTS CONTENTS"`; | ||
exports[`SnapshotInteractiveMode skip 1 test, then quit 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, then quit 2`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, then restart 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, then restart 2`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>1 snapshot reviewed<bold></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, then restart 3`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and restart 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>2 snapshots remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and restart 2`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and restart 3`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 1 test, update 1 test, then finish and restart 4`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>2 snapshots remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 2`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 3`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>2 snapshots reviewed<bold></>, <bold><yellow>2 snapshots skipped</></> | ||
|
||
exports[`SnapshotInteractiveMode updateWithResults overlay handle progress UI 1`] = ` | ||
"TEST RESULTS CONTENTS | ||
[MOCK - cursorUp] | ||
<bold>Watch Usage</> | ||
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode skip 2 tests, then finish and restart 4`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><red>2 suites failed</></>, <bold><green>1 suite passed</></> | ||
› <bold><dim>2 snapshots remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test suite.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Update Mode.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode updateWithResults with a test failure simply update UI 1`] = ` | ||
"TEST RESULTS CONTENTS | ||
[MOCK - cursorUp] | ||
exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and restart 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><red>1 suite failed</></> | ||
› <bold><dim>2 snapshots remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Update Mode.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode updateWithResults with a test success, call the next test 1`] = `"TEST RESULTS CONTENTS"`; | ||
exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and restart 2`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and restart 3`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>1 snapshot updated</></>, <bold><yellow>1 snapshot skipped</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>r<dim> to restart Interactive Snapshot Mode.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 1 test, skip 1 test, then finish and restart 4`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 1 test, then finish and return 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 1 test, then finish and return 2`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>1 snapshot reviewed<bold></>, <bold><green>1 snapshot updated</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>Enter<dim> to return to watch mode.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 2 tests, then finish and return 1`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>2 snapshots remaining<bold></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 2 tests, then finish and return 2`] = ` | ||
"[MOCK - cursorUp] | ||
[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Progress</> | ||
› <bold><dim>1 snapshot remaining<bold></>, <bold><green>1 snapshot updated</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>u<dim> to update failing snapshots for this test.</> | ||
<dim> › Press </>s<dim> to skip the current test.</> | ||
<dim> › Press </>q<dim> to quit Interactive Snapshot Mode.</> | ||
<dim> › Press </>Enter<dim> to trigger a test run.</> | ||
" | ||
`; | ||
|
||
exports[`SnapshotInteractiveMode update 2 tests, then finish and return 3`] = ` | ||
"[MOCK - eraseDown] | ||
|
||
<bold>Interactive Snapshot Result</> | ||
› <bold><dim>2 snapshots reviewed<bold></>, <bold><green>2 snapshots updated</></> | ||
|
||
<bold>Watch Usage</> | ||
<dim> › Press </>Enter<dim> to return to watch mode.</> | ||
" | ||
`; |
Oops, something went wrong.
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.
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.
in the new gif, mind turning off the text effect (https://github.com/zeit/hyper-power?)? It's a bit distracting.
And maybe consider having something like https://github.com/keycastr/keycastr? I find it a bit confusing following what's going on 🙂
Other than that, slick demo! 👍
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.
Updated, thanks for the tip