close

no-focused-tests

Added in v0.8.1

Configuration

PresetConfigured Value
✅ rstestPlugin.configs.recommended"error"
rslint.config.ts
import { defineConfig, rstestPlugin } from '@rslint/core';

export default defineConfig([
  rstestPlugin.configs.recommended,
  {
    rules: {
      'rstest/no-focused-tests': 'error',
    },
  },
]);

Rule Details

Disallows focused tests and suites. Leaving .only in committed code prevents the rest of the suite from running.

The rule recognizes .only on Rstest tests and suites, including aliases, parameterized registrations, fixtures, and Playwright integrations.

Incorrect

describe.only('user service', () => {
  test('creates a user', () => {});
});

Correct

describe('user service', () => {
  test('creates a user', () => {});
});

Suggestions

Offers a suggestion to remove .only when the focused modifier is unambiguous.