Skip to content

Latest commit

Β 

History

History
33 lines (23 loc) Β· 696 Bytes

File metadata and controls

33 lines (23 loc) Β· 696 Bytes

ava/no-useless-t-pass

πŸ“ 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.

Examples

import test from 'ava';

// ❌
test('main', t => {
	t.pass();
});

// βœ…
test('main', t => {
	t.plan(1);
	t.pass();
});

// βœ…
test('main', t => {
	t.notThrows(() => foo());
});