📝 Require tests to have a title.
💼 This rule is enabled in the ✅ recommended config.
🔧 This rule is automatically fixable by the --fix CLI option.
Translations: Français
Tests should have a title. AVA v1.0.1 and later enforces this at runtime.
The title must be a non-empty string without leading or trailing whitespace.
import test from 'ava';
test(t => { // ❌ Missing title
t.pass();
});
test(123, t => { // ❌ Non-string title
t.pass();
});
test('', t => { // ❌ Empty title
t.pass();
});
test(' foo ', t => { // ❌ Leading/trailing whitespace (auto-fixable)
t.pass();
});
test('foo', t => { // ✅
t.pass();
});