Files
formipay/node_modules/eslint-plugin-jest/docs/rules/max-nested-describe.md
dwindown e8fbfb14c1 fix: prevent asset conflicts between React and Grid.js versions
Add coexistence checks to all enqueue methods to prevent loading
both React and Grid.js assets simultaneously.

Changes:
- ReactAdmin.php: Only enqueue React assets when ?react=1
- Init.php: Skip Grid.js when React active on admin pages
- Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0
- Customer.php, Product.php, License.php: Add coexistence checks

Now the toggle between Classic and React versions works correctly.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 17:02:14 +07:00

2.8 KiB

Enforces a maximum depth to nested describe calls (max-nested-describe)

While it's useful to be able to group your tests together within the same file using describe(), having too many levels of nesting throughout your tests make them difficult to read.

Rule details

This rule enforces a maximum depth to nested describe() calls to improve code clarity in your tests.

The following patterns are considered warnings (with the default option of { "max": 5 } ):

describe('foo', () => {
  describe('bar', () => {
    describe('baz', () => {
      describe('qux', () => {
        describe('quxx', () => {
          describe('too many', () => {
            it('should get something', () => {
              expect(getSomething()).toBe('Something');
            });
          });
        });
      });
    });
  });
});

describe('foo', function () {
  describe('bar', function () {
    describe('baz', function () {
      describe('qux', function () {
        describe('quxx', function () {
          describe('too many', function () {
            it('should get something', () => {
              expect(getSomething()).toBe('Something');
            });
          });
        });
      });
    });
  });
});

The following patterns are not considered warnings (with the default option of { "max": 5 } ):

describe('foo', () => {
  describe('bar', () => {
    it('should get something', () => {
      expect(getSomething()).toBe('Something');
    });
  });

  describe('qux', () => {
    it('should get something', () => {
      expect(getSomething()).toBe('Something');
    });
  });
});

describe('foo2', function () {
  it('should get something', () => {
    expect(getSomething()).toBe('Something');
  });
});

describe('foo', function () {
  describe('bar', function () {
    describe('baz', function () {
      describe('qux', function () {
        describe('this is the limit', function () {
          it('should get something', () => {
            expect(getSomething()).toBe('Something');
          });
        });
      });
    });
  });
});

Options

{
  "jest/max-nested-describe": [
    "error",
    {
      "max": 5
    }
  ]
}

max

Enforces a maximum depth for nested describe().

This has a default value of 5.

Examples of patterns not considered warnings with options set to { "max": 2 }:

describe('foo', () => {
  describe('bar', () => {
    it('should get something', () => {
      expect(getSomething()).toBe('Something');
    });
  });
});

describe('foo2', function () {
  describe('bar2', function () {
    it('should get something', function () {
      expect(getSomething()).toBe('Something');
    });

    it('should get  else', function () {
      expect(getSomething()).toBe('Something');
    });
  });
});