Skip to content

Latest commit

 

History

History
31 lines (19 loc) · 992 Bytes

no-inline-assertions.md

File metadata and controls

31 lines (19 loc) · 992 Bytes

Ensure assertions are not called from inline arrow functions (ava/no-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.

Fail

const test = require('ava');

test('foo', t => t.true(fn()));

Pass

const test = require('ava');

test('foo', t => {
	t.true(fn());
});