karma-timer-reporter
v1.0.7
Published
Karma plugin for test timing analytics
Downloads
7
Readme
karma-timer-reporter
This reporter will list your slowest running tests in your console.
Installation
The easiest way is to keep karma-timer-reporter
as a devDependency in your package.json
.
{
"devDependencies": {
"karma": "~0.10",
"karma-timer-reporter": "~0.1"
}
}
You can add it to package.json
with the following command:
npm install karma-timer-reporter --save-dev
Configuration
// karma.conf.js
module.exports = function(config) {
config.set({
reporters: ['progress', 'timer'],
// the default configuration
timerReporter: {
maxLogLines: 10 // max slow tests to list
},
// add to plugins
plugins: [
// other plugins
'karma-timer-reporter'
],
});
};
Result
The reporter will produce lines showing your slowest tests like this
01 01 1970 00:00:01:000:INFO [reporter.timer]: AppComponent should create the app 3.039 secs
01 01 1970 00:00:01:000:INFO [reporter.timer]: AppComponent should render complicated things 2.013 secs
01 01 1970 00:00:01:000:INFO [reporter.timer]: ItemComponent should be created 0.007 secs