Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.01 KB

File metadata and controls

41 lines (27 loc) · 1.01 KB

ava/test-title

📝 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.

Examples

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();
});