Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/vodyani/coverage-report

📚 During jest testing, it was used to generate mochawesome compliant json formatted reports.
https://github.com/vodyani/coverage-report

cicd coverage javascript jest mocha mochawesome report test typescript

Last synced: about 5 hours ago
JSON representation

📚 During jest testing, it was used to generate mochawesome compliant json formatted reports.

Awesome Lists containing this project

README

        

# Vodyani coverage-report

*📚 During jest testing, it was used to generate mochawesome compliant json formatted reports.*

[![Npm](https://img.shields.io/npm/v/@vodyani/coverage-report)](https://www.npmjs.com/package/@vodyani/coverage-report)
[![Npm](https://img.shields.io/npm/dm/@vodyani/coverage-report)](https://www.npmjs.com/package/@vodyani/coverage-report)
[![License](https://img.shields.io/github/license/vodyani/coverage-report)](LICENSE)
![Workflow](https://github.com/vodyani/coverage-report/actions/workflows/release.yml/badge.svg)
[![Known Vulnerabilities](https://snyk.io/test/github/vodyani/coverage-report/badge.svg?targetFile=package.json)](https://snyk.io/test/github/vodyani/coverage-report?targetFile=package.json)

## Installation

```sh
npm install --save-dev @vodyani/coverage-report
```

## Usage

Typically, I would add the testResultsProcessor property stated in `JEST` to with the `CI/CD` execution and pass it in to take effect.

First, you should define the test commands in the `package.json` file beforehand.

```json
{
"scripts": {
"test": "jest",
"test:coverage": "jest --coverage"
}
}
```

And

```sh
npm run test --ci --testResultsProcessor="@vodyani/coverage-report"
```

**Output**

The reporter writes to `report.json` by default. The `JEST_REPORT_JSON` environment variable can be used to alter the file name.

Just like this.

```sh
JEST_REPORT_JSON="./coverage/report.json" npm run test:coverage --ci --testResultsProcessor="@vodyani/coverage-report"
```

**Example**

[*Click here to view an example of github activities in action.*](https://github.com/vodyani/workflows/blob/8aab8360f0566cb42d3ff9bcfd94e5ed4ef4b6f3/.github/workflows/publish-codecov.yml#L39)

## License

Vodyani coverage-report is [MIT licensed](LICENSE).