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', () => {});
});