no-commented-tests

July 2, 2026 ยท View on GitHub

๐Ÿ“ Disallow commented-out tests.

๐Ÿšซ This rule is disabled in the following configs: โœ… recommended, โ˜‘๏ธ unopinionated.

Commented-out tests are dead code that can silently accumulate. Use .skip() to temporarily disable tests so they remain visible and tracked by the runner. Commented-out hooks (before, after, beforeEach, afterEach) are flagged too โ€” remove them since hooks have no .skip().

Examples

import test from 'node:test';

// โŒ
// test('foo', () => {});

// โŒ
// describe('group', () => {});

// โŒ
// beforeEach(() => {});

// โœ…
test.skip('foo', () => {});

// โœ…
test('foo', () => {});