cypress-io / cypress-example-kitchensink

This is an example app used to showcase Cypress.io testing.
https://example.cypress.io/
MIT License
1.22k stars 2.2k forks source link

ci: cause skipped tests linting error #827

Closed MikeMcC399 closed 5 months ago

MikeMcC399 commented 5 months ago

Issue

eslint-plugin-mocha is configured inconsistently in this repo regarding the rules:

Since it is undesirable to have .only or .skip in the example test specs, both should be configured to error on linting.

Change

Add mocha/no-skipped-tests error to the configuration in .eslintrc.

 "rules": {
    ...
    "mocha/no-skipped-tests": "error",
    ...
  }

Verification

Temporarily modify the file cypress/e2e/2-advanced-examples/actions.cy.js to add an exclusive test and a skipped test:

and execute:

npm ci
npx eslint cypress

confirm that linting errors (no warnings) are reported:

$ npx eslint cypress

   3:9  error  Unexpected exclusive mocha test  mocha/no-exclusive-tests
  10:6  error  Unexpected skipped mocha test    mocha/no-skipped-tests

✖ 2 problems (2 errors, 0 warnings)
cypress-app-bot commented 5 months ago
cypress-app-bot commented 5 months ago

:tada: This PR is included in version 2.0.7 :tada:

The release is available on:

Your semantic-release bot :package::rocket: