π Disallow duplicate hook declarations.
πΌ This rule is enabled in the β
recommended config.
Disallow multiple hooks of the same type in a test file.
Registering the same hook type multiple times is usually a copy-paste mistake. Both hooks will run, which is confusing and error-prone. Combine the logic into a single hook instead.
import test from 'ava';
// β
test.before(t => {
// setup A
});
test.before(t => {
// setup B
});
// β
test.before(t => {
// setup A
// setup B
});