Skip to content

andyhasit/karma-nicer-reporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

karma-nicer-reporter

A nicer reporter for Karma.

npm version npm downloads

#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

Example screenshot

(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

About

A nicer reporter for Karma.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published