karma-timer-reporter
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

karma-timer-reporter

NPM version Build Status

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

Package Sidebar

Install

npm i karma-timer-reporter

Weekly Downloads

0

Version

1.0.7

License

MIT

Unpacked Size

8.81 kB

Total Files

9

Last publish

Collaborators

  • garyb432