# ava/max-asserts 📝 Limit the number of assertions in a test. 🚫 This rule is _disabled_ in the ✅ `recommended` [config](https://github.com/avajs/eslint-plugin-ava#recommended-config). Translations: [Français](https://github.com/avajs/ava-docs/blob/main/fr_FR/related/eslint-plugin-ava/docs/rules/max-asserts.md) Limit the amount of assertions in a test to enforce splitting up large tests into smaller ones. Skipped assertions are counted. ## Examples ```js /*eslint ava/max-asserts: ["error", {"max": 5}]*/ import test from 'ava'; // ❌ test('getSomeObject should define the players\' names', t => { const object = lib.getSomeObject(); t.is(typeof object, 'object'); t.is(typeof object.player, 'object'); t.is(object.player.firstName, 'Luke'); t.is(object.player.lastName, 'Skywalker'); t.is(typeof object.opponent, 'object'); t.is(object.opponent.firstName, 'Darth'); t.is(object.opponent.lastName, 'Vader'); }); // ✅ test('getSomeObject should define the player\'s name', t => { const object = lib.getSomeObject(); t.is(typeof object, 'object'); t.is(typeof object.player, 'object'); t.is(object.player.firstName, 'Luke'); t.is(object.player.lastName, 'Skywalker'); }); test('getSomeObject should define the opponent\'s name', t => { const object = lib.getSomeObject(); t.is(typeof object, 'object'); t.is(typeof object.opponent, 'object'); t.is(object.opponent.firstName, 'Darth'); t.is(object.opponent.lastName, 'Vader'); }); ``` ## Options ### max Type: `integer`\ Default: `5` The maximum number of assertions allowed in each test. You can set the option in configuration like this: ```js "ava/max-asserts": ["error", {"max": 5}] ```