test-title-format
July 15, 2026 ยท View on GitHub
๐ Require test titles to match a configured pattern.
๐ซ This rule is disabled in the following configs: โ
recommended, โ๏ธ unopinionated.
Enforce a consistent naming convention for test and suite titles by requiring them to match a configurable regular expression pattern. Hook calls have no title and are not checked.
This rule is opt-in. Configure it when your project has a naming convention such as 'Should โฆ' or 'it โฆ'.
Options
format
Type: string
A regular expression pattern string that all test titles must match.
Examples
/* eslint
node-test/test-title-format: [
'error',
{
format: '^Should'
}
]
*/
import test from 'node:test';
// โ
test('not starting with Should', () => {});
// โ
test('Should pass when called', () => {});
test('Should throw on invalid input', () => {});
/* eslint
node-test/test-title-format: [
'error',
{
format: '\\.$'
}
]
*/
import test from 'node:test';
// โ
test('doesn\'t end with a dot', () => {});
// โ
test('ends with a dot.', () => {});