# karma-htmlfile-reporter

> A Karma plugin. Report results in styled html format.

Latest version **0.3.8** (published 2019-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install karma-htmlfile-reporter
pnpm add karma-htmlfile-reporter
yarn add karma-htmlfile-reporter
bun add karma-htmlfile-reporter
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.8 |
| Published | 2019-02-01 |
| First published | 2013-10-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 15.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | Matthias Schuetz |
| Maintainers | matthias-schuetz |
| Keywords | karma-plugin, karma-reporter, html |

## Links

- npm: https://www.npmjs.com/package/karma-htmlfile-reporter
- Repository: https://github.com/matthias-schuetz/karma-htmlfile-reporter
- Homepage: https://github.com/matthias-schuetz/karma-htmlfile-reporter#readme
- Issues: https://github.com/matthias-schuetz/karma-htmlfile-reporter/issues
- npm.io page: https://npm.io/package/karma-htmlfile-reporter

## Dependencies (1)

- [xmlbuilder](https://npm.io/package/xmlbuilder.md) ^10.0.0

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 0.3.8 (latest) — 2019-02-01
- 0.3.7 — 2018-09-28
- 0.3.6 — 2018-08-08
- 0.3.5 — 2017-01-14
- 0.3.4 — 2016-06-22
- 0.3.3 — 2016-06-19
- 0.3.2 — 2016-06-18
- 0.3.1 — 2016-06-04
- 0.3.0 — 2016-06-02
- 0.2.3 — 2016-05-31
- 0.2.2 — 2015-07-27
- 0.2.1 — 2015-05-28
- 0.2.0 — 2015-05-28
- 0.1.2 — 2014-05-21
- 0.1.0 — 2013-10-06

## README

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].

<img src="http://matthias-schuetz.github.io/karma-htmlfile-reporter/karma-htmlfile-reporter.png?2" />

## HTML test result page
Version 0.3 comes with a fresh style from [David G Chung](https://github.com/davidc4747). You can see a preview of the exported unit test result page [here](http://matthias-schuetz.github.io/karma-htmlfile-reporter/units.html). A new option called *groupSuites* will group separate suites (*describe* blocks in test files) visually, see an example output [here](http://matthias-schuetz.github.io/karma-htmlfile-reporter/units_groups.html). You can also set the option *useCompactStyle* to *true* to export a more compact HTML output. The legacy page style is online [here](http://matthias-schuetz.github.io/karma-htmlfile-reporter/units_legacy.html). 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`.
```json
{
  "devDependencies": {
    "karma": "~0.10",
    "karma-htmlfile-reporter": "~0.3"
  }
}
```

You can simple do it by:
```bash
npm install karma-htmlfile-reporter --save-dev
```

It may also be necessary to install globally:
```bash
npm install -g karma-htmlfile-reporter
```

## Configuration
```js
// 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:
```bash
karma start --reporters html
```

----

For more information on Karma see the [homepage].

[Karma Test Runner]: https://github.com/karma-runner/karma
[karma-junit-reporter plugin]: https://github.com/karma-runner/karma-junit-reporter
[homepage]: http://karma-runner.github.com

---
_Source: https://npm.io/package/karma-htmlfile-reporter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
