{"record":{"id":"347a74b76c0d2843","repo":"oxc-project/oxc","slug":"test-is-missing-function-argument","errorCode":null,"errorMessage":"Test is missing function argument","messagePattern":"Test is missing function argument","errorType":"validation","errorClass":"OxcDiagnostic","httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/shared/jest_vitest/no_disabled_tests.rs","lineNumber":51,"sourceCode":"describe['skip']('bar', () => {});\nit['skip']('bar', () => {});\ntest['skip']('bar', () => {});\n\nxdescribe('foo', () => {});\nxit('foo', () => {});\nxtest('foo', () => {});\n\nit('bar');\ntest('bar');\n\nit('foo', () => {\n  pending();\n});\n```\n\";\n\nfn no_disabled_tests_diagnostic(x1: &'static str, x2: &'static str, span3: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(x1).with_help(x2).with_label(span3)\n}\n\nenum Message {\n    MissingFunction,\n    Pending,\n    DisabledSuiteWithSkip,\n    DisabledSuiteWithX,\n    DisabledTestWithSkip,\n    DisabledTestWithX,\n}\n\nimpl Message {\n    pub fn details(&self) -> (&'static str, &'static str) {\n        match self {\n            Self::MissingFunction => (\"Test is missing function argument\", \"Add function argument\"),\n            Self::Pending => (\"Call to pending()\", \"Remove pending() call\"),\n            Self::DisabledSuiteWithSkip => (\"Disabled test suite\", \"Remove the appending `.skip`\"),\n            Self::DisabledSuiteWithX => (\"Disabled test suite\", \"Remove x prefix\"),","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/oxc-project/oxc/blob/a3d33dda7cb69da23db4fcaa2c0c05de61e760a1/crates/oxc_linter/src/rules/shared/jest_vitest/no_disabled_tests.rs#L33-L69","documentation":"One of the four diagnostics of oxlint rule `jest/no-disabled-tests` (shared with vitest), from the Message::MissingFunction variant in crates/oxc_linter/src/rules/shared/jest/vitest/no_disabled_tests.rs. It fires when a test/it call has only a title argument and no callback function, so the test body is missing entirely.","triggerScenarios":"Exactly the condition checked at no_disabled_tests.rs:103-109: the call parses as JestGeneralFnKind::Test, `call_expr.arguments.len() < 2`, and no member is named `todo`. So `it('foo')`, `test('bar')` trigger it, while `test('todo case', ...)` with two args or `it.todo('plan')` do not.","commonSituations":"Scaffolding a test file and leaving empty stubs; deleting a callback during refactor and forgetting; old Jest style where `it('name')` without fn implicitly meant pending (modern Jest throws instead); merge accidents dropping the second argument.","solutions":["Add the missing callback: it('foo', () => { /* assertions */ })","If the test is intentionally not written yet, use the explicit form it.todo('foo')","Delete stub calls that will never be implemented rather than leaving title-only calls"],"exampleFix":"// before\nit('validates user');\ntest('sums numbers');\n\n// after\nit('validates user', () => { expect(isUser(u)).toBe(true); });\ntest.todo('sums numbers');","handlingStrategy":"validation","validationCode":"rg -n \"\\b(?:it|test)\\(\\s*['\\\"][^'\\\"]+['\\\"]\\s*\\)\" tests/","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use TypeScript-checked test signatures so a missing callback is a compile error","Scaffold tests with test.todo('name') instead of title-only stubs","Treat 'test is missing function argument' as a hard error (--deny-warnings) so stubs never merge"],"tags":["jest","vitest","oxlint","testing","incomplete-test","missing-argument"],"backgroundTag":"missing-test-callback","analyzedSha":"a3d33dda7cb69da23db4fcaa2c0c05de61e760a1","analyzedAt":"2026-08-20T07:01:07.079Z","contentChangedAt":"2026-08-20T07:01:07.079Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}