A nicer reporter for Karma.
#What is this?
A nicer reporter for karma test runner (nicer than the default progress reoprter anyway) designed to show you what you need to know at a glance.
Some features:
- Only prints details for failed tests
- Color-coded summary passed/failed/skipped per suite
- Shortens URLs of file paths to remove visual clutter
- Configurable colors
(Screenshot from ConEmu on Windows)
#Installation
npm install karma-nicer-reporter --save-dev
#Usage
In your karma configuration file include nicer as a (or the) reporter.
...
reporters: ['nicer'],
...
#Configuration
Adding a nicerReporter entry in your karma configuration file, you can override the default colors (which come from chalk).
...
nicerReporter : {
defaulColor: 'cyan',
successColor: 'green',
failColor: 'red',
skipColor: 'yellow',
errorLogColor: 'white'
}
...
#Development
There is an example karma.conf.js and some example specs you can run to see the output. These are best run using:
gulp test
Which overwrites index.js in the node_modules folder before running karma start.
One feature missing is times for individual tests, which isn't there because we don't print individual tests unless they fail. Perhaps it could be included as a second runner.
Also, this has only been tested on Chrome and PhantomJS, with:
autoWatch: false,
singleRun: true,
And not in any CI enviroment.
#Licence
MIT