jest/padding-around-test-blocks
eslint-plugin-jest
Safe autofix
eslint.config.js
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/padding-around-test-blocks": "error",
},
},
];const thing = 123;
test('foo', () => {});
test('bar', () => {});const thing = 123;
it('foo', () => {});
it('bar', () => {});const thing = 123;
test('foo', () => {});
test('bar', () => {});const thing = 123;
it('foo', () => {});
it('bar', () => {});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.
jest/padding-around-test-blocks
eslint-plugin-jest
import jest from "eslint-plugin-jest";
export default [
{
plugins: { jest },
rules: {
"jest/padding-around-test-blocks": "error",
},
},
];jest/padding-around-test-blocks
jest plugin · style
{
"plugins": [
"jest"
],
"rules": {
"jest/padding-around-test-blocks": "error"
}
}Biome does not have this rule.
Suggest using the built-in comparison matchers
Enforce padding around describe blocks
Enforce padding around beforeEach blocks