test-nested-describe
a nested `describe` outside the `when …` / `for …` exception
Deterministic checkadvisory by defaultbasetests
The argument
This rule states its summary and proves it with an example.
The proof
failsubject.unit.test.ts
import { expect, describe, test } from '@jest/globals';
import { getLabel } from './getLabel';
describe('getLabel', () => {
describe('padded names', () => {
test('trims it', () => {
const label = getLabel({ name: ' Ada ' });
expect(label).toBe('Ada');
});
});
});
passsubject.unit.test.ts
import { expect, describe, test } from '@jest/globals';
import { getLabel } from './getLabel';
describe('getLabel', () => {
describe('when the name is padded', () => {
test('trims it', () => {
const label = getLabel({ name: ' Ada ' });
expect(label).toBe('Ada');
});
});
});
Turn it down
Both lines go in your lightsout.config.json.
"standards-checks": { "test-nested-describe": "advisory" }"standards-checks": { "test-nested-describe": "off" }