-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add summary_reporter.test.js #5389
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
aeb8170
add special option -- for npm update command
kdnakt 270362a
Update CHANGELOG.md
kdnakt d7473dd
Merge branch 'master' into fix-update-command-npm
kdnakt 8457640
add testcase for summary_reporter.js
kdnakt f8b7082
Merge branch 'fix-update-command-npm' of https://github.com/kdnakt/je…
kdnakt 80cd696
add testcase for yarn
kdnakt 9a26ddb
Merge branch 'master' into fix-update-command-npm
kdnakt 85d5b9d
Update CHANGELOG.md
kdnakt c5bdfa3
import SummaryReporter at the top
kdnakt 210987e
remove duplicated definition of results
kdnakt 85707c6
remove description
kdnakt 8f99c3e
add snapshot test
kdnakt c2b608a
update test title
kdnakt 38c10f8
remove duplicated line
kdnakt 480269f
add missing attributes for test results
kdnakt 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
add snapshot test
- Loading branch information
commit 8f99c3e879fa4ed9fdfde5163a256626b153099e
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
packages/jest-cli/src/reporters/__tests__/__snapshots__/summary_reporter.test.js.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
|
||
| exports[`npm test 1`] = ` | ||
| "<bold>Snapshot Summary</> | ||
| <bold><red> › 2 snapshot tests</></> failed in 1 test suite. <dim>Inspect your code changes or run \`npm test -- -u\` to update them.</> | ||
| " | ||
| `; | ||
|
|
||
| exports[`yarn test 1`] = ` | ||
| "<bold>Snapshot Summary</> | ||
| <bold><red> › 2 snapshot tests</></> failed in 1 test suite. <dim>Inspect your code changes or run \`yarn test -u\` to update them.</> | ||
| " | ||
| `; |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,20 +41,12 @@ test('npm test', () => { | |
| process.stderr.write = result => results.push(result); | ||
| const testReporter = new SummaryReporter(globalConfig); | ||
| testReporter.onRunComplete(new Set(), aggregatedResults); | ||
| expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); | ||
| expect(results[1]).toMatch( | ||
| '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + | ||
| '\u001b[2mInspect your code changes or run `npm test -- -u` to update them.\u001b[22m', | ||
| ); | ||
| expect(results[0] + results[1]).toMatchSnapshot(); | ||
|
||
| }); | ||
|
|
||
| test('yarn test', () => { | ||
| process.env.npm_config_user_agent = 'yarn'; | ||
| const testReporter = new SummaryReporter(globalConfig); | ||
| testReporter.onRunComplete(new Set(), aggregatedResults); | ||
| expect(results[0]).toMatch('\u001b[1mSnapshot Summary\u001b[22m'); | ||
| expect(results[1]).toMatch( | ||
| '\u001b[1m\u001b[31m › 2 snapshot tests\u001b[39m\u001b[22m failed in 1 test suite. ' + | ||
| '\u001b[2mInspect your code changes or run `yarn test -u` to update them.\u001b[22m', | ||
| ); | ||
| expect(results[0] + results[1]).toMatchSnapshot(); | ||
| }); | ||
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.
This is already done in
beforeEach