{"record":{"id":"2fb1662892bda3ca","repo":"oxc-project/oxc","slug":"describe-requires-name-and-callback-arguments","errorCode":null,"errorMessage":"Describe requires name and callback arguments","messagePattern":"Describe requires name and callback arguments","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs","lineNumber":18,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{Argument, Expression, FunctionBody, Statement},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{\n    context::LintContext,\n    utils::{JestFnKind, JestGeneralFnKind, PossibleJestNode, parse_general_jest_fn_call},\n};\n\nfn valid_describe_callback_diagnostic(\n    x1: &'static str,\n    x2: &'static str,\n    span3: Span,\n) -> OxcDiagnostic {\n    OxcDiagnostic::warn(x1).with_help(x2).with_label(span3)\n}\n\n#[derive(Clone, Copy)]\npub struct ValidDescribeCallbackOptions {\n    allow_async_describe_callback: bool,\n    allow_describe_options_argument: bool,\n}\n\nimpl ValidDescribeCallbackOptions {\n    pub const JEST: Self =\n        Self { allow_async_describe_callback: false, allow_describe_options_argument: false };\n\n    pub const VITEST: Self =\n        Self { allow_async_describe_callback: true, allow_describe_options_argument: true };\n}\n\npub fn run<'a>(\n    possible_jest_node: &PossibleJestNode<'a, '_>,","sourceCodeStart":1,"sourceCodeEnd":36,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs#L1-L36","documentation":"Diagnostic from the oxlint `jest/valid-describe-callback` rule (source: crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:18). This variant ('Describe requires name and callback arguments') fires when a `describe()` call has fewer than two arguments - missing the title or the callback. Jest would misbehave or error at runtime, so this rule catches the mistake at lint time.","triggerScenarios":"`describe('title')`, `describe(() => {})`, or `describe()` - any describe call where either the name argument or the callback argument is absent (the source checks argument count before types).","commonSituations":"Incomplete scaffolding left in a spec file; merge artifacts that drop a callback; auto-generated tests from scripts that emit malformed describes; typos during refactors.","solutions":["Give describe both arguments: a string title and a function callback, e.g. `describe('feature', () => { /* tests */ })`.","Delete the fragment if it is leftover scaffolding.","If a custom wrapper around describe is being flagged, rename it or configure the framework's globals so the rule can tell them apart."],"exampleFix":"// before\ndescribe('user service');\n\n// after\ndescribe('user service', () => {\n  test('loads a user', () => { /* ... */ });\n});","handlingStrategy":"validation","validationCode":"// rg -nU \"describe\\(\\'[^\\']*\\'\\)\" tests/  # describe with no callback\n// rg -n \"describe\\(\\(\\)\" tests/","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use editor snippets so describe always emits title + empty callback together","Run oxlint in the editor to catch malformed describes as you type"],"tags":["jest","vitest","oxlint","describe","validation"],"backgroundTag":"jest-describe-callback-validation","analyzedSha":"e1e7af627c8843ab64044ed466b128fcc21a035b","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}