-
Notifications
You must be signed in to change notification settings - Fork 89
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
Suggestion: add rule that prevents focused tests #57
Comments
An alternative to using the plugin eslint-plugin-no-only-tests as a workaround would be to use the plugin eslint-plugin-mocha instead.
The rule mocha/no-exclusive-tests is better suited to Cypress tests than the no-only-tests/no-only-tests rule. The latter rule attempts to check usage of ExampleIn the cypress-io/cypress-example-kitchensink repo the two plugins – eslint-plugin-cypress and eslint-plugin-mocha – are successfully combined using:
adding also the rule:
makes the tests fail instead of producing a warning in case an |
Given that the |
Wow, May 2020 was two companies and several projects ago for me... We are still with Cypress, though, and looking at the current configuration I see that The question whether you want to rely on 3rd party plugin to help Cypress users I'm leaving to you :) |
Thank you @khitrenovich for responding again after such a long time! It's good to hear that you are still with Cypress and that practical experience says that you can use mocha/no-exclusive-tests from eslint-plugin-mocha for the purpose that you originally submitted your suggestion for.
This plugin extensively relies on open source software from other contributors. When you install this plugin it currently says "added 92 packages". These are all npm modules from the npm registry. Installing eslint-plugin-mocha additionally shows "added 5 packages". This is all part of using open source software, with its risks and benefits! I'm going to close this issue now as you have confirmed that your needs are met. |
We have a rule that prevents focused tests by default in Jest eslint plugin (https://github.com/jest-community/eslint-plugin-jest/blob/master/docs/rules/no-focused-tests.md), but not in Cypress. As a workaround, we are adding https://www.npmjs.com/package/eslint-plugin-no-only-tests to our Cypress eslint configuration, but it would be nice to have this straight from
plugin:cypress/recommended
configuration.The text was updated successfully, but these errors were encountered: