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"
  }
}

How to use

To enable this rule in the CLI or using the config file, you can use:

bash
oxlint --deny jest/no-commented-out-tests --jest-plugin
json
{
  "plugins": ["jest"],
  "rules": {
    "jest/no-commented-out-tests": "error"
  }
}

References

Released under the MIT License.