karma-jasmine-html-reporter
Advanced tools
Comparing version 1.5.1 to 1.5.2
{ | ||
"name": "karma-jasmine-html-reporter", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "A Karma plugin. Dynamically displays tests results at debug.html page", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
@@ -31,3 +31,23 @@ # karma-jasmine-html-reporter | ||
``` | ||
#### With options | ||
In combination with multiple reporters you may want to disable failed messages because it's already handled by another reporter. | ||
*Example when using the 'karma-mocha-reporter' plugin*: | ||
```js | ||
// karma.conf.js | ||
module.exports = function(config) { | ||
config.set({ | ||
// Combine multiple reporters | ||
reporters: ['kjhtml', 'mocha'], | ||
jasmineHtmlReporter: { | ||
// Suppress failed messages | ||
suppressFailed: true | ||
} | ||
}); | ||
}; | ||
``` | ||
You can pass a list of reporters as a CLI argument too: | ||
@@ -34,0 +54,0 @@ ```bash |
@@ -6,7 +6,16 @@ var JASMINE_CORE_PATTERN = /([\\/]karma-jasmine[\\/])/i; | ||
var initReporter = function (files, baseReporterDecorator) { | ||
var initReporter = function (karmaConfig, baseReporterDecorator) { | ||
var jasmineCoreIndex = 0; | ||
const files = karmaConfig.files; | ||
baseReporterDecorator(this); | ||
if (karmaConfig.jasmineHtmlReporter) { | ||
const config = karmaConfig.jasmineHtmlReporter; | ||
if (config.suppressFailed) { | ||
this.specFailure = () => void 0; | ||
} | ||
} | ||
files.forEach(function (file, index) { | ||
@@ -23,3 +32,3 @@ if (JASMINE_CORE_PATTERN.test(file.pattern)) { | ||
initReporter.$inject = ['config.files', 'baseReporterDecorator']; | ||
initReporter.$inject = ['config', 'baseReporterDecorator']; | ||
@@ -26,0 +35,0 @@ module.exports = { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
134498
922
64