-
-
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: add summaryThreshold option to summary reporter #13895
Merged
SimenB
merged 18 commits into
jestjs:main
from
stefanosgk:feature/add-option-to-always-print-failure-messages-in-summary
Mar 1, 2023
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
c3ed2e1
Add option to always print failure messages in summary
stefanosgk b011e75
Update changelog
stefanosgk 6cdffcb
Add summaryThreshold option to summary reporter
stefanosgk cf4990f
Update docs/Configuration.md
stefanosgk 9666de8
Update docs/Configuration.md
stefanosgk f46aa52
Minor improvements
stefanosgk 13caa0f
Move summary options type closer to class
stefanosgk 5b2c39e
Merge branch 'main' of https://github.com/facebook/jest into feature/…
stefanosgk 1b03d59
Add missing newline
stefanosgk 23301de
Improve condition
stefanosgk 11b8e9b
Merge branch 'main' of https://github.com/facebook/jest into feature/…
stefanosgk 028b2e0
Merge branch 'main' of https://github.com/facebook/jest into feature/…
stefanosgk 26b6820
Merge branch 'main' into feature/add-option-to-always-print-failure-m…
SimenB 12c060d
Merge branch 'main' into feature/add-option-to-always-print-failure-m…
SimenB 6aa3a2a
Add type anotation
stefanosgk 8f0a649
Merge branch 'main' of https://github.com/facebook/jest into feature/…
stefanosgk 2fdf015
Merge branch 'feature/add-option-to-always-print-failure-messages-in-…
stefanosgk b6cb477
Merge branch 'main' into feature/add-option-to-always-print-failure-m…
SimenB 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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
import runJest from '../runJest'; | ||
|
||
['default', 'summary'].forEach(reporter => { | ||
describe(`${reporter} reporter`, () => { | ||
test('prints failure messages when total number of test suites is over summaryThreshold', () => { | ||
const {exitCode, stderr} = runJest('summary-threshold', [ | ||
'--config', | ||
JSON.stringify({ | ||
reporters: [[reporter, {summaryThreshold: 2}]], | ||
}), | ||
]); | ||
|
||
expect(exitCode).toBe(1); | ||
expect(stderr).toMatch( | ||
/Summary of all failing tests(\n|.)*expect\(1\)\.toBe\(0\)/, | ||
); | ||
expect(stderr).toMatch( | ||
/Summary of all failing tests(\n|.)*expect\(2\)\.toBe\(0\)/, | ||
); | ||
}); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
'use strict'; | ||
|
||
test('fails', () => { | ||
expect(1).toBe(0); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
'use strict'; | ||
|
||
test('fails', () => { | ||
expect(2).toBe(0); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
'use strict'; | ||
|
||
test('passes', () => { | ||
expect(1).toBe(1); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"jest": { | ||
"testEnvironment": "node" | ||
} | ||
} |
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
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
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
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.
I went checking if
options
is always defined. Apparently normalization always add an object. That’s smart idea!