close

no-identical-title

Added in v0.7.3

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-identical-title': 'error',
    },
  },
]);

Rule Details

Disallow the same static title for two tests or two describe blocks in the same scope.

Examples of incorrect code:

test("loads user", () => {});
test.only("loads user", () => {});

describe("api", () => {});
describe.skip("api", () => {});

Examples of correct code:

describe("api", () => {
  test("loads user", () => {});

  describe("nested", () => {
    test("loads user", () => {});
  });
});

Test titles and describe titles are tracked separately. Dynamic titles are ignored. Parameterized .each and .for registration titles are also ignored because Rstest expands them at runtime.