# max-nested-describe πŸ“ Enforce a maximum depth for nested `describe` blocks. πŸ’ΌπŸš« This rule is enabled in the βœ… `recommended` [config](https://github.com/sindresorhus/eslint-node-test#preset-configs). This rule is _disabled_ in the β˜‘οΈ `unopinionated` [config](https://github.com/sindresorhus/eslint-node-test#preset-configs). Deeply nested `describe` blocks make a test file hard to read: the setup for a test is spread across many enclosing scopes, and the indentation alone obscures what is being tested. A deep nest usually means the suite is trying to do too much and should be split into separate files. This rule reports `describe`/`suite` blocks nested beyond a configurable depth (default 5). ## Options ```js { 'node-test/max-nested-describe': [ 'error', { max: 5 // maximum nesting depth (default: 5) } ] } ``` ## Examples ```js import {describe, it} from 'node:test'; // ❌ (with max: 2) describe('a', () => { describe('b', () => { describe('c', () => { it('is too deep', () => {}); }); }); }); // βœ… (with max: 2) describe('a', () => { describe('b', () => { it('is fine', () => {}); }); }); ```