Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.only and .skip rule needs #180

Closed
MikeMcC399 opened this issue Apr 21, 2024 · 1 comment · Fixed by #181
Closed

.only and .skip rule needs #180

MikeMcC399 opened this issue Apr 21, 2024 · 1 comment · Fixed by #181

Comments

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Apr 21, 2024

Issue

Users have requested linting support to detect .only and .skip constructs and have submitted some issues and PRs to have these rules built in to eslint-plugin-cypress.

Suggestion

  1. Add a section to the README to cover using the eslint-plugin-mocha plugin alongside the eslint-plugin-cypress plugin.
  2. Close the open PRs feat(rule): add no-focused-tests rule #82 and feat: Implement no-exclusive-tests rule #148.

Notes

Mocha

As stated in the Cypress documentation Core Concepts > Writing and Organizing Tests > Writing Tests

Cypress is built on top of Mocha and Chai

eslint-plugin-mocha

The npm module eslint-plugin-mocha provides ESLint rules for mocha including the rules:

  • mocha/no-exclusive-tests to warn about the use of describe.only, it.only, suite.only, test.only, context.only and specify.only within the source code.
  • mocha/no-skipped-tests to warn about the use of describe.skip, it.skip, suite.skip, test.skip, context.skip, specify.skip, xdescribe, xit, xcontext and xspecify within the source code.

The plugin eslint-plugin-mocha is used together with eslint-plugin-cypress in the cypress-io/cypress-example-kitchensink repo under ESLint 8.x.

Related issues / PRs

@cypress-app-bot
Copy link

🎉 This issue has been resolved in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants