karma-mocha-reporter
Advanced tools
Comparing version 0.2.8 to 0.3.0
16
index.js
@@ -20,2 +20,6 @@ 'use strict'; | ||
config.mochaReporter = config.mochaReporter || {}; | ||
var outputMode = config.mochaReporter.output || 'full'; | ||
// disable chalk when colors is set to false | ||
@@ -253,4 +257,6 @@ if (config.colors === false) { | ||
if (item.count === self.numberOfBrowsers) { | ||
// print results to output when test is run through all browsers | ||
print(self.allResults, depth); | ||
// print results to output when test was ran through all browsers | ||
if (outputMode !== 'minimal') { | ||
print(self.allResults, depth); | ||
} | ||
} | ||
@@ -289,3 +295,3 @@ } else { | ||
self.onRunComplete = function (browsers, results) { | ||
browsers.forEach(function(browser){ | ||
browsers.forEach(function (browser) { | ||
self.totalTime += browser.lastResult.totalTime; | ||
@@ -315,2 +321,6 @@ }); | ||
} | ||
if (outputMode === 'autowatch') { | ||
outputMode = 'minimal'; | ||
} | ||
}; | ||
@@ -317,0 +327,0 @@ }; |
{ | ||
"name": "karma-mocha-reporter", | ||
"description": "Karma reporter with mocha style logging.", | ||
"version": "0.2.8", | ||
"version": "0.3.0", | ||
"homepage": "http://www.litixsoft.de/modules-karmamochareporter", | ||
@@ -6,0 +6,0 @@ "author": "Litixsoft GmbH <info@litixsoft.de> (http://www.litixsoft.de)", |
@@ -19,3 +19,3 @@ # karma-mocha-reporter | ||
"karma": "^0.12", | ||
"karma-mocha-reporter": "^0.2.0" | ||
"karma-mocha-reporter": "^0.3.0" | ||
} | ||
@@ -47,2 +47,35 @@ } | ||
## Options | ||
### output | ||
**Type:** String | ||
**Possible Values:** | ||
* `full` (default) | ||
* `autowatch` | ||
* `minimal` | ||
With option `full` all output is printed to the console. The option `autowatch` means that the first run will have the full output and the next runs just output the summary and errors in mocha style. With the option `minimal` only the summary and errors are printed to the console in mocha style. | ||
```js | ||
// karma.conf.js | ||
module.exports = function(config) { | ||
config.set({ | ||
frameworks: ['jasmine'], | ||
// reporters configuration | ||
reporters: ['mocha'], | ||
// reporter options | ||
mochaReporter: { | ||
output: 'autowatch' | ||
}, | ||
plugins: [ | ||
'karma-jasmine', | ||
'karma-mocha-reporter' | ||
] | ||
}); | ||
}; | ||
``` | ||
## Contributing | ||
@@ -56,2 +89,5 @@ In lieu of a formal styleguide take care to maintain the existing coding style. Lint and test your code using [grunt](http://gruntjs.com/). | ||
## Release History | ||
### v0.3.0 | ||
* add option "output" to set the output level of the reporter | ||
### v0.2.8 | ||
@@ -58,0 +94,0 @@ * add module log-symbols for printing symbols to the console |
17725
273
145