Skip to content
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

Added suppressAll option to config #40

Merged
merged 5 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ module.exports = function(config) {
};
```
#### With options
In combination with multiple reporters you may want to disable failed messages because it's already handled by another reporter.
In combination with multiple reporters you may want to disable terminal messages because it's already handled by another reporter.

*Example when using the 'karma-mocha-reporter' plugin*:
*Example using the 'karma-mocha-reporter' plugin*:
```js
// karma.conf.js
module.exports = function(config) {
Expand All @@ -41,8 +41,8 @@ module.exports = function(config) {
reporters: ['kjhtml', 'mocha'],

jasmineHtmlReporter: {
// Suppress failed messages
suppressFailed: true
suppressAll: true, // Suppress all messages (overrides other suppress settings)
suppressFailed: true // Suppress failed messages
}

});
Expand Down
4 changes: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ var initReporter = function (karmaConfig, baseReporterDecorator) {

if (karmaConfig.jasmineHtmlReporter) {
const config = karmaConfig.jasmineHtmlReporter;
if (config.suppressAll) {
this.onSpecComplete = () => void 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

onSpecComplete handles specFailure so it's not needed here.

this.onRunComplete = () => void 0;
}
if (config.suppressFailed) {
this.specFailure = () => void 0;
}
Expand Down