Skip to content

jest/no-commented-out-tests Suspicious ​

What it does ​

This rule raises a warning about commented out tests. It's similar to no-disabled-tests rule.

Why is this bad? ​

You may forget to uncomment some tests. This rule raises a warning about commented out tests. It's similar to no-disabled-tests rule.

Example ​

javascript
// describe('foo', () => {});
// it('foo', () => {});
// test('foo', () => {});

// describe.skip('foo', () => {});
// it.skip('foo', () => {});
// test.skip('foo', () => {});

This rule is compatible with eslint-plugin-vitest, to use it, add the following configuration to your .eslintrc.json:

json
{
  "rules": {
    "vitest/no-commented-out-tests": "error"
  }
}

References ​

Released under the MIT License.