-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Interactive Snapshot Mode improvements (#5864)
* Interactive Snapshot Mode updates * Update docs * Squash images * More squashing * Update snaps * Move arrow to a const * Add comment * Update GIF * Clarify cursorUp usage * Update snaps * Update CHANGELOG * Add AssertionLocation type
- Loading branch information
1 parent
2bd5dfd
commit 3c65b72
Showing
12 changed files
with
780 additions
and
137 deletions.
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.