# apiway-report-generator

> Generates gorgeous HTML reports from mochawesome reporter.

Latest version **0.0.2** (published 2017-06-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install apiway-report-generator
pnpm add apiway-report-generator
yarn add apiway-report-generator
bun add apiway-report-generator
```

Provides the command `marge`.

## 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.0.2 |
| Published | 2017-06-06 |
| First published | 2017-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 13 |
| Known vulnerabilities | 0 (+3 in 1 direct dependencies) |
| Install scripts | no |
| Author | bluehackmaster |
| Maintainers | bluehackmaster |
| Keywords | mochawesome, mocha, reporter, json, react, report generator |

## Links

- npm: https://www.npmjs.com/package/apiway-report-generator
- Repository: https://github.com/apiway/apiway-report-generator
- Homepage: https://github.com/apiway/apiway-report-generator#readme
- Issues: https://github.com/apiway/apiway-report-generator/issues
- npm.io page: https://npm.io/package/apiway-report-generator

## Dependencies (13)

- [fsu](https://npm.io/package/fsu.md) ^1.0.2
- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [react](https://npm.io/package/react.md) ^15.3.2
- [tcomb](https://npm.io/package/tcomb.md) ^3.2.17
- [yargs](https://npm.io/package/yargs.md) ^7.0.2
- [opener](https://npm.io/package/opener.md) ^1.4.2
- [fs-extra](https://npm.io/package/fs-extra.md) ^3.0.0
- [react-dom](https://npm.io/package/react-dom.md) ^15.3.2
- [validator](https://npm.io/package/validator.md) ^7.0.0
- [dateformat](https://npm.io/package/dateformat.md) ^2.0.0
- [prop-types](https://npm.io/package/prop-types.md) ^15.5.8
- [tcomb-validation](https://npm.io/package/tcomb-validation.md) ^3.3.0
- [lodash.isfunction](https://npm.io/package/lodash.isfunction.md) ^3.0.8

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 0.0.2 (latest) — 2017-06-06
- 0.0.1 — 2017-06-06

## README

mochawesome-report-generator (marge)
============================
[![npm](https://img.shields.io/npm/v/mochawesome-report-generator.svg?style=flat-square)](http://www.npmjs.com/package/mochawesome-report-generator) [![Build Status](https://img.shields.io/travis/adamgruber/mochawesome-report-generator/master.svg?style=flat-square)](https://travis-ci.org/adamgruber/mochawesome-report-generator) [![Code Climate](https://img.shields.io/codeclimate/github/adamgruber/mochawesome-report-generator.svg?style=flat-square)](https://codeclimate.com/github/adamgruber/mochawesome-report-generator)

**marge** (**m**och**a**wesome-**r**eport-**ge**nerator) is the counterpart to [mochawesome][2], a custom reporter for use with the Javascript testing framework, [mocha][1]. Marge takes the JSON output from [mochawesome][2] and generates a full fledged HTML/CSS report that helps visualize your test suites.

## :tada: New in 2.0.0
- Multi-file support via CLI
- New options: [overwrite](#overwrite) and [timestamp](#timestamp)

## Features
- All-new redesigned and streamlined report
- At-a-glance stats including pass percentage
- Beautiful charts
- Support for nested `describe`s
- Supports pending tests
- Filter view by test type
- Quick navigation menu
- Review test code inline
- Stack trace for failed tests
- Inline diffs for actual vs expected results
- Responsive and mobile-friendly
- Supports displaying additional test context
- Custom report [options](#cli-options)
- Offline viewing
- CLI for generating reports independent of [mochawesome][2]

## Browser Support
Tested to work in Chrome. *Should* work in any modern web browser including IE9+.
**marge** generates a self-contained report that can be viewed offline. 

## Sample Report

<img src="./docs/marge-report-1.0.1.png" alt="Mochawesome Report" width="75%" />
<img src="./docs/marge-report-menu-1.0.1.png" alt="Mochawesome Report Menu" width="75%" />


## Usage

**via CLI**

Install mochawesome-report-generator package
```bash
npm install -g mochawesome-report-generator
```

Run the command
```bash
marge [options] data_file [data_file2 ...]
```

**via Mochawesome reporter**

See mochawesome [docs][2].

## Output
**marge** generates the following inside your project directory:
```
mochawesome-report/
├── assets
│   ├── app.css
│   ├── app.js
│   ├── MaterialIcons-Regular.woff
│   ├── MaterialIcons-Regular.woff2
│   ├── roboto-light-webfont.woff
│   ├── roboto-light-webfont.woff2
│   ├── roboto-medium-webfont.woff
│   ├── roboto-medium-webfont.woff2
│   ├── roboto-regular-webfont.woff
│   └── roboto-regular-webfont.woff2
└── mochawesome.html
```

## CLI Options

**marge** can be configured via command line flags

Flag | Type | Default | Description 
:--- | :--- | :------ | :----------
-f, --reportFilename | string | | Filename of saved report
-o, --reportDir | string | [cwd]/mochawesome-report | Path to save report
-t, --reportTitle | string | mochawesome | Report title
-p, --reportPageTitle | string | mochawesome-report | Browser title
-i, --inline | boolean | false | Inline report assets (scripts, styles)
--charts | boolean | true | Display Suite charts
--code | boolean | true | Display test code
--autoOpen | boolean | false | Automatically open the report
--overwrite | boolean | true | Overwrite existing report files. *See [notes](#overwrite).*
--timestamp, --ts | string | | Append timestamp in specified format to report filename. *See [notes](#timestamp).*
--dev | boolean | false | Enable dev mode (requires local webpack dev server)
-h, --help | | | Show CLI help


*Boolean options can be negated by adding `--no` before the option. For example: `--no-code` would set `code` to `false`.*

#### Overwrite
By default, report files are overwritten by subsequent report generation. Passing `--overwrite=false` will not replace existing files. Instead, if a duplicate filename is found, the report will be saved with a counter digit added to the filename. (ie. `mochawesome_001.html`).

**Note:** `overwrite` will always be `false` when passing multiple files or using the `timestamp` option.

#### Timestamp
The `timestamp` option can be used to append a timestamp to the report filename. It uses [dateformat][] to parse format strings so you can pass any valid string that [dateformat][] accepts with a few exceptions. In order to produce valid filenames, the following replacements are made:

Characters | Replacement | Example | Output
:--- | :--- | :--- | :---
spaces, commas | underscore | Wed March 29, 2017 | Wed_March_29_2017
slashes | hyphen | 3/29/2017 | 3-29-2017
colons | null | 17:46:21 | 174621

Further, if you pass the flag with no format string, it will default to `isoDateTime`.

[1]: https://mochajs.org/
[2]: https://github.com/adamgruber/mochawesome
[dateformat]: https://github.com/felixge/node-dateformat

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