karma-htmlfile-reporter

A Karma plugin. Report results in styled html format.

karma-htmlfile-reporter

This is a plugin for the Karma Test Runner. By adding this reporter to your karma configuration, unit test results will be exported as a styled HTML file. For each test browser, a separate table is generated. The plugin is based on the karma-junit-reporter plugin.

Click here to see an example of the exported unit test result page.

The easiest way is to keep karma-htmlfile-reporter as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "~0.10",
    "karma-htmlfile-reporter": "~0.1"
  }
}

You can simple do it by:

npm install karma-htmlfile-reporter --save-dev
// karma.conf.js 
module.exports = function(config) {
  config.set({
    plugins : [
      'karma-htmlfile-reporter'
    ],
 
    reporters: ['progress', 'html'],
 
    htmlReporter: {
      outputFile: 'tests/units.html'
    }
  });
};

You can pass list of reporters as a CLI argument too:

karma start --reporters html,dots

For more information on Karma see the homepage.