jest/max-nested-describe
eslint-plugin-jest
No autofix
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/max-nested-describe": "error",
},
},
];describe('foo', () => {
describe('bar', () => {
describe('baz', () => {
describe('qux', () => {
describe('quxx', () => {
describe('too many', () => {
it('should get something', () => {
expect(getSomething()).toBe('Something');
});
});
});
});
});
});
});describe('foo', () => {
describe('bar', () => {
it('should get something', () => {
expect(getSomething()).toBe('Something');
});
});
describe('qux', () => {
it('should get something', () => {
expect(getSomething()).toBe('Something');
});
});
});Examples from the Biome documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
jest/max-nested-describe
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/max-nested-describe": "error",
},
},
];jest/max-nested-describe
jest plugin · style
{
"plugins": [
"jest"
],
"rules": {
"jest/max-nested-describe": "error"
}
}complexity/noExcessiveNestedTestSuites
complexity · since 1.6.0
{
"linter": {
"rules": {
"complexity": {
"noExcessiveNestedTestSuites": "error"
}
}
}
}Require describe block to be less than set max value or default value
Suggest using the built-in equality matchers
Prefer having hooks in a consistent order