vitest/max-nested-describe

March 1, 2026 ยท View on GitHub

๐Ÿ“ Require describe block to be less than set max value or default value.

โš ๏ธ This rule warns in the ๐ŸŒ all config.

Rule Details

Examples of incorrect code for this rule with max: 1:

describe('outer', () => {
  describe('inner', () => {
    // ...
  })
})

Examples of correct code for this rule:

describe('inner', () => {
  // ...
})

Options

NameDescriptionType
maxMaximum allowed nesting depth for describe blocks.Number

Default: 5

Maximum number of nested describe blocks.

{
  max: number
}