noExcessiveNestedTestSuites
Esta página aún no está disponible en tu idioma.
Summary
Section titled “Summary”- Rule available since: 
v1.6.0 - Diagnostic Category: 
lint/complexity/noExcessiveNestedTestSuites - This rule doesn’t have a fix.
 - The default severity of this rule is information.
 - This rule belongs to the following domains:
 - Sources:
- Same as 
jest/max-nested-describe - Same as 
vitest/max-nested-describe 
 - Same as 
 
How to configure
Section titled “How to configure”{  "linter": {    "rules": {      "complexity": {        "noExcessiveNestedTestSuites": "error"      }    }  }}Description
Section titled “Description”This rule enforces a maximum depth to nested describe() in test files.
To improve code clarity in your tests, the rule limits nested describe to 5.
Examples
Section titled “Examples”Invalid
Section titled “Invalid”describe('foo', () => {  describe('bar', () => {    describe('baz', () => {      describe('qux', () => {        describe('quxx', () => {          describe('too many', () => {            it('should get something', () => {              expect(getSomething()).toBe('Something');            });          });        });      });    });  });});code-block.js:6:11 lint/complexity/noExcessiveNestedTestSuites ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  ℹ Excessive `describe()` nesting detected.
  
     4 │       describe(‘qux’, () => {
     5 │         describe(‘quxx’, () => {
   > 6 │           describe(‘too many’, () => {
       │           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   > 7 │             it(‘should get something’, () => {
   > 8 │               expect(getSomething()).toBe(‘Something’);
   > 9 │             });
  > 10 │           });
       │           ^^
    11 │         });
    12 │       });
  
  ℹ Excessive nesting of describe() calls can hinder test readability.
  
  ℹ Consider refactoring and reduce the level of nested describe to improve code clarity.
  
describe('foo', () => {  describe('bar', () => {    it('should get something', () => {      expect(getSomething()).toBe('Something');    });  });  describe('qux', () => {    it('should get something', () => {      expect(getSomething()).toBe('Something');    });  });});Related links
Section titled “Related links”Copyright (c) 2023-present Biome Developers and Contributors.