# padding-around-expect-groups

Rule `jest/padding-around-expect-groups`. Enforce padding around `expect` groups

- Source: jest
- Technologies: Testing
- Kind: style
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1751 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jest/padding-around-expect-groups` | no | safe | package `eslint-plugin-jest` | [docs](https://github.com/jest-community/eslint-plugin-jest/blob/v29.17.2/docs/rules/padding-around-expect-groups.md) |
| Oxlint | `jest/padding-around-expect-groups` | no | safe | plugin `jest`, category style | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jest/padding-around-expect-groups.html) |

## Code examples

### Incorrect: the rule reports this

```js
test('thing one', () => {
  let abc = 123;
  expect(abc).toEqual(123);
  expect(123).toEqual(abc);
  abc = 456;
  expect(abc).toEqual(456);
});
```

### Correct: the rule accepts this

```js
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.

## Enable it

### ESLint: `eslint.config.js`

```js
import jest from "eslint-plugin-jest";

export default [
  {
    plugins: { jest },
    rules: {
      "jest/padding-around-expect-groups": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jest"
  ],
  "rules": {
    "jest/padding-around-expect-groups": "error"
  }
}
```

## Related rules

- [vitest/padding-around-expect-groups](https://lintradar.dev/rules/vitest/padding-around-expect-groups.md): Enforce padding around `expect` groups
- [jest/padding-around-describe-blocks](https://lintradar.dev/rules/jest/padding-around-describe-blocks.md): Enforce padding around `describe` blocks
- [jest/padding-around-test-blocks](https://lintradar.dev/rules/jest/padding-around-test-blocks.md): Enforce padding around `test` and `it` blocks
- [jest/padding-around-before-each-blocks](https://lintradar.dev/rules/jest/padding-around-before-each-blocks.md): Enforce padding around `beforeEach` blocks
- [jest/prefer-comparison-matcher](https://lintradar.dev/rules/jest/prefer-comparison-matcher.md): Suggest using the built-in comparison matchers
- [jest/padding-around-before-all-blocks](https://lintradar.dev/rules/jest/padding-around-before-all-blocks.md): Enforce padding around `beforeAll` blocks

---

Web page: https://lintradar.dev/rules/jest/padding-around-expect-groups. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
