tslint-plugin-cypress

1.0.4 • Public • Published

tslint-plugin-cypress

Build Status

Set of tslint rules for testing with cypress.io.

Motivation

Main purpose of this package is to prevent working with return values of Cypress commands.

From cypress.io:

You cannot assign or work with the return values of any Cypress command. Commands are enqueued and run asynchronously.

How to use?

Typescript and tslint has to be installed and setup.

npm i -D tslint-plugin-cypress

Then add these to your tslint.json file.

{
  "extends": "tslint-plugin-cypress"
}

Run

./node_modules/.bin/tslint -c tslint.json -p . cypress/**/*.ts -t stylish

If you have troubles with setup, Look at example repo here.

Note: Unfortunately, VS code doesn't support plugins which requires type information.

Rules

no-chainable-assignment

Prevents assignment return values of Cypress commands (type Chainable) to variables. Includes variable declaration, assignment to existing variable, object property assignment and array literal expressions.

no-chainable-arguments

Prevents passing return values of Cypress commands (type Chainable) to function arguments.

Package Sidebar

Install

npm i tslint-plugin-cypress

Weekly Downloads

406

Version

1.0.4

License

ISC

Unpacked Size

25 kB

Total Files

21

Last publish

Collaborators

  • krzysztof-grzybek