close

no-commented-out-tests

Added in v0.7.3

Configuration

PresetConfigured Value
✅ rstestPlugin.configs.recommended"warn"
rslint.config.ts
import { defineConfig, rstestPlugin } from '@rslint/core';

export default defineConfig([
  rstestPlugin.configs.recommended,
  {
    rules: {
      'rstest/no-commented-out-tests': 'error',
    },
  },
]);

Rule Details

Disallows tests and suites hidden in comments. Commented-out tests are easy to miss in review and can remain stale indefinitely.

Use test.todo when a test should remain visible but is not ready to run. The rule recognizes commented test, it, and describe registrations, including modifiers and parameterized forms.

Incorrect

// test('rejects an invalid email', () => {
//   expect(validateEmail('invalid')).toBe(false);
// });

Correct

test.todo('rejects an invalid email');