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