{"record":{"id":"b6a00f790e9700e6","repo":"oxc-project/oxc","slug":"unexpected-argument-s-in-describe-callback","errorCode":null,"errorMessage":"Unexpected argument(s) in describe callback","messagePattern":"Unexpected argument\\(s\\) in describe callback","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 ('Unexpected argument(s) in describe callback') fires when the describe callback declares parameters. Jest never passes anything to a describe callback, so parameters such as `done` indicate a mistaken copy from a test callback.","triggerScenarios":"`describe('feature', (done) => { ... })` or `describe('feature', (a, b) => { ... })` - the callback's parameter list is non-empty, verified when the rule walks the function's params.","commonSituations":"Promoting a test into a describe without stripping its `done` parameter; converting callback-style tests to describes; IDE auto-import creating unexpected signatures.","solutions":["Delete the callback parameters: `describe('feature', () => { ... })`.","If you need an async done-style flow, it belongs in a `test((done) => {...})` callback, not describe.","Move setup/teardown into beforeEach/afterEach hooks instead of parameterizing describe."],"exampleFix":"// before\ndescribe('db', (done) => {\n  test('connects', () => { /* ... */ });\n});\n\n// after\ndescribe('db', () => {\n  test('connects', (done) => {\n    connect().then(() => done());\n  });\n});","handlingStrategy":"validation","validationCode":"// rg -nU \"describe\\([^)]*,\\s*\\([^)]*\\)\\s*=>\" tests/ -t ts -t js","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Describe callbacks take zero parameters - done/a/b belong in test callbacks","Review converted tests for leftover parameters"],"tags":["jest","vitest","oxlint","describe","callback-params"],"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-14T05:17:10.506Z"}