# expect-expect

Rule `jest/expect-expect`. Enforce assertion to be made in a test body

- Source: jest
- Technologies: Testing
- Kind: correctness
- Needs type information: no
- Autofix: no
- Reach: 16.7M weekly downloads of presets that enable it
- Trend: +10.1% last quarter
- Rank: #653 by reach, #1460 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| ESLint | `jest/expect-expect` | yes | no | package `eslint-plugin-jest` | [docs](https://github.com/jest-community/eslint-plugin-jest/blob/v29.17.2/docs/rules/expect-expect.md) |
| Oxlint | `jest/expect-expect` | no | no | plugin `jest`, category correctness | [docs](https://oxc.rs/docs/guide/usage/linter/rules/jest/expect-expect.html) |
| Biome | `suspicious/useExpect` | no | no | group suspicious, since 2.4.2 | [docs](https://biomejs.dev/linter/rules/use-expect/) |

## Code examples

### Incorrect: the rule reports this

```js
it('should be a test', () => {
  console.log('no assertion');
});
test('should assert something', () => {});
```

### Correct: the rule accepts this

```js
it('should be a test', () => {
  expect(true).toBeDefined();
});
it('should work with callbacks/async', () => {
  somePromise().then(res => expect(res).toBe('passed'));
});
```

Examples from the ESLint documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

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

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "suspicious": {
        "useExpect": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Jest recommended](https://lintradar.dev/presets/jest-recommended.md) | ESLint | `eslint-plugin-jest` | 19 | 16.7M | +10.1% |

## Related rules

- [vitest/expect-expect](https://lintradar.dev/rules/vitest/expect-expect.md): Enforce having expectation in test body
- [jest/no-conditional-expect](https://lintradar.dev/rules/jest/no-conditional-expect.md): Disallow calling `expect` conditionally
- [jest/no-done-callback](https://lintradar.dev/rules/jest/no-done-callback.md): Disallow using a callback in asynchronous tests and hooks
- [jest/no-jasmine-globals](https://lintradar.dev/rules/jest/no-jasmine-globals.md): Disallow Jasmine globals
- [jest/no-standalone-expect](https://lintradar.dev/rules/jest/no-standalone-expect.md): Disallow using `expect` outside of `it` or `test` blocks
- [jest/valid-title](https://lintradar.dev/rules/jest/valid-title.md): Enforce valid titles

---

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