max-nested-describe
Configuration
rslint.config.ts
Rule Details
Enforce a maximum depth for nested describe() calls. Grouping tests with describe is useful, but too many nested levels make suites harder to read and navigate.
This rule counts every Jest suite call as a nesting level, including fdescribe, xdescribe, describe.only, describe.skip, and describe.each.
Examples of incorrect code for this rule (with the default { "max": 5 }):
Examples of correct code for this rule (with the default { "max": 5 }):
Options
- First argument (optional): object with
maxmax: maximum allowed nesting depth fordescribe()calls. Default is5. A value of0disallows anydescribeblock.
Examples of correct code with { "max": 2 }:
Examples of incorrect code with { "max": 2 }: