# valid-expect-in-promise

Rule `jest/valid-expect-in-promise`. Require promises that have expectations in their chain to be valid

- 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: #666 by reach, #1473 by growth

## Linters

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

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jest"
  ],
  "rules": {
    "jest/valid-expect-in-promise": "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/valid-expect-in-promise](https://lintradar.dev/rules/vitest/valid-expect-in-promise.md): Require promises that have expectations in their chain to be valid
- [jest/valid-describe-callback](https://lintradar.dev/rules/jest/valid-describe-callback.md): Enforce valid `describe()` callback
- [jest/no-test-prefixes](https://lintradar.dev/rules/jest/no-test-prefixes.md): Require using `.only` and `.skip` over `f` and `x`
- [jest/no-mocks-import](https://lintradar.dev/rules/jest/no-mocks-import.md): Disallow manually importing from `__mocks__`
- [jest/no-interpolation-in-snapshots](https://lintradar.dev/rules/jest/no-interpolation-in-snapshots.md): Disallow string interpolation inside snapshots
- [jest/no-deprecated-functions](https://lintradar.dev/rules/jest/no-deprecated-functions.md): Disallow use of deprecated functions

---

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