# prefer-mock-promise-shorthand

Rule `jest/prefer-mock-promise-shorthand`. Prefer mock resolved/rejected shorthands for promises

- 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: #1759 by reach

## Linters

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

## Enable it

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

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

export default [
  {
    plugins: { jest },
    rules: {
      "jest/prefer-mock-promise-shorthand": "error",
    },
  },
];
```

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jest"
  ],
  "rules": {
    "jest/prefer-mock-promise-shorthand": "error"
  }
}
```

## Related rules

- [vitest/prefer-mock-promise-shorthand](https://lintradar.dev/rules/vitest/prefer-mock-promise-shorthand.md): Enforce mock resolved/rejected shorthands for promises
- [jest/prefer-jest-mocked](https://lintradar.dev/rules/jest/prefer-jest-mocked.md): Prefer `jest.mocked()` over `fn as jest.Mock`
- [jest/prefer-mock-return-shorthand](https://lintradar.dev/rules/jest/prefer-mock-return-shorthand.md): Prefer mock return shorthands
- [jest/prefer-expect-resolves](https://lintradar.dev/rules/jest/prefer-expect-resolves.md): Prefer `await expect(...).resolves` over `expect(await ...)` syntax
- [jest/prefer-snapshot-hint](https://lintradar.dev/rules/jest/prefer-snapshot-hint.md): Prefer including a hint with external snapshots
- [jest/prefer-expect-assertions](https://lintradar.dev/rules/jest/prefer-expect-assertions.md): Suggest using `expect.assertions()` OR `expect.hasAssertions()`

---

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