Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-htmlfile-reporter

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-htmlfile-reporter

A Karma plugin. Report results in styled html format.

  • 0.3.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
45K
decreased by-3.72%
Maintainers
1
Weekly downloads
 
Created
Source

karma-htmlfile-reporter

A karma plugin for exporting unit test results as styled HTML file

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.

HTML test result page

Version 0.3 comes with a fresh style from David G Chung. You can see a preview of the exported unit test result page here. A new option called groupSuites will group separate suites (describe blocks in test files) visually, see an example output here. You can also set the option useCompactStyle to true to export a more compact HTML output. The legacy page style is online here. If you want to use the legacy style, you can set the option useLegacyStyle to true. There's also an additional option called showOnlyFailed which forces the report to display failed tests only.

Installation

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

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

You can simple do it by:

npm install karma-htmlfile-reporter --save-dev

It may also be necessary to install globally:

npm install -g karma-htmlfile-reporter

Configuration

// karma.conf.js
module.exports = function(config) {
  config.set({
    reporters: ['progress', 'html'],

    htmlReporter: {
      outputFile: 'tests/units.html',
			
      // Optional
      pageTitle: 'Unit Tests',
      subPageTitle: 'A sample project description',
      groupSuites: true,
      useCompactStyle: true,
      useLegacyStyle: true,
      showOnlyFailed: false
    }
  });
};

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

karma start --reporters html

For more information on Karma see the homepage.

Keywords

FAQs

Package last updated on 01 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc