# mocha-sloth-reporter

> Mocha reporter to detect slow tests and display to github actions if enabled

Latest version **0.0.10** (published 2020-07-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install mocha-sloth-reporter
pnpm add mocha-sloth-reporter
yarn add mocha-sloth-reporter
bun add mocha-sloth-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.0.10 |
| Published | 2020-07-03 |
| First published | 2020-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 40.3 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Edward Romero |
| Maintainers | legolamel |
| Keywords | mocha, slow, test, reporter, action, github |

## Links

- npm: https://www.npmjs.com/package/mocha-sloth-reporter
- Repository: https://github.com/meroware/mocha-sloth-reporter
- Homepage: https://github.com/meroware/mocha-sloth-reporter#readme
- Issues: https://github.com/meroware/mocha-sloth-reporter/issues
- npm.io page: https://npm.io/package/mocha-sloth-reporter

## Dependencies (2)

- [chalk](https://npm.io/package/chalk.md) 4.1.0
- [@actions/core](https://npm.io/package/@actions/core.md) 1.2.4

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 0.0.10 (latest) — 2020-07-03
- 0.0.7 — 2020-06-29
- 0.0.6 — 2020-06-27
- 0.0.5 — 2020-06-25
- 0.0.4 — 2020-06-25
- 0.0.3 — 2020-06-25
- 0.0.2 — 2020-06-25
- 0.0.1 — 2020-06-25

## README

# mocha-sloth-reporter

Mocha reporter to detect slow tests and display to github actions if enabled

## Getting Started

### Installing

```
npm install --save-dev mocha-sloth-reporter
```

### How To Use

    mocha --reporter mocha-sloth-reporter

#### Parametes 

`--slow <Integer>`
  - Default: 75 ms
  - Display:
    - If test is higher than value then it will be displayed in yellow
    - If test is higher than double the value then it will be displayed in red
  - Example:
    ```
    mocha --reporter mocha-sloth-reporter --slow 100
    ```

`--actions <boolean>`
  - Default: false
  - Display:
    - If test is higher than value then it will be displayed as warning if actions enabled
    - If test is higher than double the value then it will be displayed as error if actions enabled
  - Example:
    ```
    mocha --reporter mocha-sloth-reporter --actions true
    ```

`--inline <boolean>`
  - Default: false
  - Display:
    - It set to true, it will provide the results inline after each test and not in a summarized way after the tests are finalized.
  - Example:
    ```
    mocha --reporter mocha-sloth-reporter --inline true
    ```
    
### Output

#### Console Output

```
Slothy Test Count: 1

1006 ms Slothy Suite Such A Slothy Test
```

#### Github Actions Annotations Output

![Github Actions Annotations Output](img/Github-Actions-Annotations-Output.png)

## Contributing

TBD

## Authors

* **Edward Romero** - *Initial work*

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

## Acknowledgments

* Original reporter was inspired by [catdad/mocha-slow-test-reporter](https://github.com/catdad/mocha-slow-test-reporter)

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