Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cypress-monocart-coverage

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cypress-monocart-coverage

Cypress Coverage Plugin for Monocart Coverage Reports

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
222
increased by0.91%
Maintainers
1
Weekly downloads
 
Created
Source

cypress-monocart-coverage

A Cypress coverage plugin for monocart coverage reports

Install

npm i cypress-monocart-coverage

Feature

  • Cypress 13+
  • V8 Coverage Only
  • Supported Browsers
    • chrome
    • chromium
    • edge

Usage for E2E Testing

  • add support
// cypress/support/e2e.js
import 'cypress-monocart-coverage/support';
  • add plugin
// cypress.config.js
const { defineConfig } = require('cypress');
const CypressCoveragePlugin = require('cypress-monocart-coverage');
module.exports = defineConfig({
    e2e: {
        setupNodeEvents(on, config) {
            CypressCoveragePlugin(on, config, {
                name: 'My Cypress e2e Coverage Report',
                entryFilter: {
                    '**/*.cy.js': true
                },
                outputDir: './coverage-reports/e2e',
                reports: [
                    'v8',
                    'console-details',
                    'raw'
                ]
            });
        }
    }
});

Usage for Component Testing

  • add support
// cypress/support/component.js
import 'cypress-monocart-coverage/support';
  • add plugin
// cypress.config.js
const { defineConfig } = require('cypress');
const CypressCoveragePlugin = require('cypress-monocart-coverage');
module.exports = defineConfig({
    component: {
        setupNodeEvents(on, config) {
            CypressCoveragePlugin(on, config, {
                name: 'My Cypress component Coverage Report',
                entryFilter: {
                    '**/src/spec*.js': true
                },
                sourceFilter: {
                    '**/cypress/component/**': true
                },
                outputDir: './coverage-reports/component',
                reports: [
                    'v8',
                    'console-details',
                    'raw'
                ]
            });
        },

        devServer: {
            framework: 'react',
            bundler: 'webpack'
        }
    }
});

How to Merging E2E and Component Coverage Reports

"scripts": {
    "test": "npm run test:e2e && npm run test:component && npm run merge",
    "test:e2e": "npx cypress run --browser edge",
    "test:component": "npx cypress run --component --browser edge",
    "merge": "node ./merge-coverage.js"
}

FAQs

Package last updated on 13 Mar 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc