šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

cypress-jest-coverage-merge

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-jest-coverage-merge

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

1.0.2
latest
Source
npm
Version published
Weekly downloads
352
-8.57%
Maintainers
1
Weekly downloads
Ā 
Created
Source

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

  • Install
    npm i -D cypress-jest-coverage-merge
    
    Or
    yarn add -D cypress-jest-coverage-merge
    
  • 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',
    ...
    
  • configure nyc in package.json to set Cypress coverage report directory to tests/coverage/cypress:
    ...
    "nyc": {
        "report-dir": "tests/coverage/cypress",
        "reporter": [
               "lcov",
               "json"
           ]
        }
    ...
    
  • Run your Cypress tests and output coverage to a tests/coverage/cypress/ directory.
  • Run your Jest tests and output coverage to a tests/coverage/jest directory.
  • Run npx cypress-jest-coverage-merge and check the tests/coverage/reports directory for the merged report!

Keywords

cypress

FAQs

Package last updated on 04 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts