# cypress-jest-coverage-merge

> A helper to merge Cypress and Jest coverage reports into one report file.

Latest version **1.0.2** (published 2021-02-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install cypress-jest-coverage-merge
pnpm add cypress-jest-coverage-merge
yarn add cypress-jest-coverage-merge
bun add cypress-jest-coverage-merge
```

Provides the command `cypress-jest-coverage-merge`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2021-02-04 |
| First published | 2021-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | qdhuxp |
| Maintainers | qdhuxp |
| Keywords | cypress, jest, tests, nyc, coverage |

## Links

- npm: https://www.npmjs.com/package/cypress-jest-coverage-merge
- Repository: https://github.com/qdhuxp/cypress-jest-coverage-merge
- Homepage: https://github.com/qdhuxp/cypress-jest-coverage-merge#readme
- Issues: https://github.com/qdhuxp/cypress-jest-coverage-merge/issues
- npm.io page: https://npm.io/package/cypress-jest-coverage-merge

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.0

## 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

- 1.0.2 (latest) — 2021-02-04
- 1.0.1 — 2021-02-01
- 1.0.0 — 2021-01-29

## README

# cypress-jest-coverage-merge
## A helper to merge Cypress and Jest coverage reports into one report file.

This script is inspired by this example of merging Cypress & Jest reports: https://github.com/bahmutov/cypress-and-jest and https://github.com/transmissionsdev/merge-cypress-jest-coverag.

For better compatibility with multiple OS(Windows/Linux), this project uses nodejs APIs to handle files, such as copy/move/mkdir etc.

## Usage
1. Install
    ```javascript
    npm i -D cypress-jest-coverage-merge
    ```
    Or
    ```javascript
    yarn add -D cypress-jest-coverage-merge
    ```
2. configure jest.config.js to set jest coverage report directory to `tests/coverage/jest`:
    ```
    ...
    // Indicates whether the coverage information should be collected while executing the test
    collectCoverage: true,
    // The directory where Jest should output its coverage files
    coverageDirectory: '<rootDir>/tests/coverage/jest',
    ...
    ```
3. configure `nyc` in `package.json` to set Cypress coverage report directory to `tests/coverage/cypress`:
    ```
    ...
    "nyc": {
        "report-dir": "tests/coverage/cypress",
        "reporter": [
               "lcov",
               "json"
           ]
        }
    ...
    ```
3. Run your Cypress tests and output coverage to a `tests/coverage/cypress/` directory.
5. Run your Jest tests and output coverage to a `tests/coverage/jest` directory.
6. Run `npx cypress-jest-coverage-merge` and check the `tests/coverage/reports` directory for the merged report!

---
_Source: https://npm.io/package/cypress-jest-coverage-merge · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
