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