test-title

July 2, 2026 Β· View on GitHub

πŸ“ Require tests to have a title.

πŸ’ΌπŸš« This rule is enabled in the βœ… recommended config. This rule is disabled in the β˜‘οΈ unopinionated config.

πŸ”§ This rule is automatically fixable by the --fix CLI option.

Tests must have a descriptive string title. A missing title makes test output harder to read and diagnose.

The title must be a non-empty string without leading or trailing whitespace. Leading/trailing whitespace is auto-fixable.

Examples

import test from 'node:test';

// ❌ Missing title
test(() => {});

// ❌ Non-string title
test(123, () => {});

// ❌ Empty title
test('', () => {});

// ❌ Leading/trailing whitespace (auto-fixable)
test(' my test ', () => {});

// βœ…
test('my test', () => {});
test('another test', async t => {
	await t.test('nested', () => {});
});