{"record":{"id":"18b959eb954d38c3","repo":"oxc-project/oxc","slug":"describe-block-title-is-used-multiple-times-in-the","errorCode":null,"errorMessage":"Describe block title is used multiple times in the same describe block.","messagePattern":"Describe block title is used multiple times in the same describe block\\.","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/shared/jest_vitest/no_identical_title.rs","lineNumber":20,"sourceCode":"    AstKind,\n    ast::{Argument, CallExpression},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_semantic::NodeId;\nuse oxc_span::Span;\nuse rustc_hash::FxHashMap;\n\nuse crate::{\n    AstNode,\n    context::LintContext,\n    utils::{\n        JestFnKind, JestGeneralFnKind, PossibleJestNode, collect_possible_jest_call_node,\n        parse_general_jest_fn_call,\n    },\n};\n\nfn describe_repeat(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Describe block title is used multiple times in the same describe block.\")\n        .with_help(\"Change the title of describe block.\")\n        .with_label(span)\n}\n\nfn test_repeat(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Test title is used multiple times in the same describe block.\")\n        .with_help(\"Change the title of test.\")\n        .with_label(span)\n}\n\npub const DOCUMENTATION: &str = r\"### What it does\n\nThis rule looks at the title of every test and test suite.\nIt will report when two test suites or two test cases at the same level of a test suite have the same title.\n\n### Why is this bad?\n\nHaving identical titles for two different tests or test suites may create confusion.","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/shared/jest_vitest/no_identical_title.rs#L2-L38","documentation":"The describe variant of oxlint rule `jest/no-identical-title` (shared with vitest), the describe_repeat constructor at crates/oxc_linter/src/rules/shared/jest_vitest/no_identical_title.rs:21. Two sibling describe blocks directly under the same parent must not share a title; the rule tracks titles per level in an FxHashMap and reports the repeated title.","triggerScenarios":"Two or more describe() calls with equal string-literal titles at the same nesting level under the same parent describe (or both at top level). The second and subsequent duplicates are labeled with their span.","commonSituations":"Copy-pasting a suite and forgetting to rename; parameterized suites generated with identical names; test reports becoming ambiguous because two suites print the same path; refactors that moved suites under a common parent.","solutions":["Rename the duplicate describe so each sibling has a distinct, descriptive title","If the suites differ by case/data, encode the difference in the title (e.g. 'checkout - guest' vs 'checkout - logged in')","If they truly duplicate each other, delete one of the suites"],"exampleFix":"// before\ndescribe('parser', () => { /* ... */ });\ndescribe('parser', () => { /* ... */ });\n\n// after\ndescribe('parser: expressions', () => { /* ... */ });\ndescribe('parser: declarations', () => { /* ... */ });","handlingStrategy":"validation","validationCode":"npx oxlint -c .oxlintrc.json tests/ # jest/no-identical-title reports sibling describes sharing a title","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When copy-pasting a describe, rename it in the same edit","Make titles describe scope ('parser: errors'), not repeat the parent","Keep reporters in mind: unique sibling titles keep failure output unambiguous"],"tags":["jest","vitest","oxlint","testing","titles","duplicates","describe"],"backgroundTag":"duplicate-test-title","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}