ava/no-async-fn-without-await

February 8, 2026 ยท View on GitHub

๐Ÿ“ Require async tests to use await.

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

๐Ÿ’ก This rule is manually fixable by editor suggestions.

Translations: Franรงais

AVA comes with built-in support for async functions (async/await). This allows you to write shorter and clearer tests.

Declaring an async test without using the await keyword means that either a Promise is not awaited on as intended, or that the function could have been declared as a regular function, which is confusing and slower.

This rule will report an error when it finds an async test which does not use the await keyword.

Examples

import test from 'ava';

// โŒ
test('foo', async t => {
	return foo().then(res => {
		t.is(res, 1);
	});
});

// โœ…
test('foo', async t => {
	t.is(await foo(), 1);
});