MikeDupree / cypress-staged

A cypress test runner that runs against staged files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cypress Staged

A Staged File Testing Solution for Cypress

Installation

The following installation methods are supported:

  • Npm: npm install --save-dev @mdupree/cypress-staged
  • Yarn: yarn add -D @mdupree/cypress-staged
  • Pnpm: pnpm install --save-dev @mdupree/cypress-staged

Configuration

To configure Cypress Staged, create a cystaged.config.js file with the following content:

module.exports = {
  projectsPath: "ExampleProjects/*",
  include: "src",
  types: [ "component" ]
  cypressPath: "./node_modules/.bin/cypress"
};

The following configuration options are available:

  • projectsPath: The path to the projects, in case of a monorepo setup, where each project has its own Cypress configuration.
  • include: The directory to check for changes, and all staged files found within this directory will be tested.
  • types: An array of Cypress test types, including component, e2e, and unit.
  • cypressPath: (optional) The path to cypress executable. defaults to the projects node_modules/.bin/cypress

How to use

Commit some changes and run cypress-staged

About

A cypress test runner that runs against staged files


Languages

Language:TypeScript 91.5%Language:JavaScript 4.5%Language:HTML 3.9%