ava/no-inline-assertions

February 8, 2026 ยท View on GitHub

๐Ÿ“ Disallow inline assertions.

๐Ÿ’ผ This rule is enabled in the โœ… recommended config.

๐Ÿ”ง This rule is automatically fixable by the --fix CLI option.

Translations: Franรงais

The test implementation should not purely consist of an inline assertion as assertions do not return a value and having them inline also makes the tests less readable.

This rule is fixable. It will wrap the assertion in braces {}. It will not do any whitespace or style changes.

Examples

import test from 'ava';

test('foo', t => t.true(fn())); // โŒ

test('foo', t => { // โœ…
	t.true(fn());
});