π Disallow useless t.pass().
πΌ This rule is enabled in the β
recommended config.
t.pass() only increments the assertion counter. Without t.plan(), this counter is never checked, making t.pass() a no-op that gives a false sense of testing.
If the intent is to verify code doesn't throw, use t.notThrows() or t.notThrowsAsync() instead.
import test from 'ava';
// β
test('main', t => {
t.pass();
});
// β
test('main', t => {
t.plan(1);
t.pass();
});
// β
test('main', t => {
t.notThrows(() => foo());
});