# no-focused-tests

Rule `jest/no-focused-tests`. Disallow focused tests

- Source: jest
- Technologies: Testing
- Kind: correctness
- Needs type information: no
- Autofix: yes, in at least one linter
- Reach: 48.5M weekly downloads of presets that enable it
- Trend: +56.7% last quarter
- Rank: #257 by reach, #728 by growth

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
describe.only("foo", () => {});
```

```js
test.only("foo", () => {});
```

```js
test.only.each([["a"]])("%s", (a) => {});
```

### Correct: the rule accepts this

```js
test("foo", () => {});
```

```js
test.each([["a"]])("%s", (a) => {});
```

Examples from the Biome documentation.

## Enable it

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

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

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

### Oxlint: `.oxlintrc.json`

```json
{
  "plugins": [
    "jest"
  ],
  "rules": {
    "jest/no-focused-tests": "error"
  }
}
```

### Biome: `biome.json`

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

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Jest recommended](https://lintradar.dev/presets/jest-recommended.md) | ESLint | `eslint-plugin-jest` | 19 | 16.7M | +10.1% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |
| [React Native](https://lintradar.dev/presets/react-native.md) | ESLint | `@react-native/eslint-config` | 79 | 1.2M | +5.8% |

## Related rules

- [vitest/no-focused-tests](https://lintradar.dev/rules/vitest/no-focused-tests.md): Disallow focused tests
- [jest/no-identical-title](https://lintradar.dev/rules/jest/no-identical-title.md): Disallow identical titles
- [jest/no-export](https://lintradar.dev/rules/jest/no-export.md): Disallow using `exports` in files containing tests
- [jest/no-duplicate-hooks](https://lintradar.dev/rules/jest/no-duplicate-hooks.md): Disallow duplicate setup and teardown hooks
- [jest/no-test-return-statement](https://lintradar.dev/rules/jest/no-test-return-statement.md): Disallow explicitly returning from tests
- [jest/no-disabled-tests](https://lintradar.dev/rules/jest/no-disabled-tests.md): Disallow disabled tests

---

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