vitest/max-nested-describe
@vitest/eslint-plugin
No autofix
eslint.config.js
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/max-nested-describe": "error",
},
},
];Require describe block to be less than set max value or default value
describe('outer', () => {
describe('inner', () => {
// ...
})
})describe('inner', () => {
// ...
})Examples from the ESLint 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.
vitest/max-nested-describe
@vitest/eslint-plugin
import vitest from "@vitest/eslint-plugin";
export default [
{
plugins: { vitest },
rules: {
"vitest/max-nested-describe": "error",
},
},
];vitest/max-nested-describe
vitest plugin · style
{
"plugins": [
"vitest"
],
"rules": {
"vitest/max-nested-describe": "error"
}
}complexity/noExcessiveNestedTestSuites
complexity · since 1.6.0
{
"linter": {
"rules": {
"complexity": {
"noExcessiveNestedTestSuites": "error"
}
}
}
}Enforces a maximum depth to nested describe calls
Disallow duplicate hooks and teardown hooks
Disallow return statements in tests
Enforce using toBeCalledTimes(1) or toHaveBeenCalledTimes(1)
Enforce using toBeCalledWith() or toHaveBeenCalledWith()