{"record":{"id":"94290e3f29be8c4b","repo":"oxc-project/oxc","slug":"suggest-using-test-todo","errorCode":null,"errorMessage":"Suggest using `test.todo`.","messagePattern":"Suggest using `test\\.todo`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/oxc_linter/src/rules/shared/jest_vitest/prefer_todo.rs","lineNumber":14,"sourceCode":"use oxc_ast::{\n    AstKind,\n    ast::{Argument, CallExpression, Expression},\n};\nuse oxc_diagnostics::OxcDiagnostic;\nuse oxc_span::{GetSpan, Span};\n\nuse crate::{\n    context::LintContext,\n    utils::{JestFnKind, JestGeneralFnKind, PossibleJestNode, is_type_of_jest_fn_call},\n};\n\nfn prefer_todo_diagnostic(span: Span) -> OxcDiagnostic {\n    OxcDiagnostic::warn(\"Suggest using `test.todo`.\").with_label(span)\n}\n\npub const DOCUMENTATION: &str = r\"### What it does\n\nWhen test cases are empty then it is better to mark them as `test.todo` as it\nwill be highlighted in the summary output.\n\n### Why is this bad?\n\nThis rule triggers a warning if empty test cases are used without 'test.todo'.\n\n### Examples\n\nExamples of **incorrect** code for this rule:\n```javascript\ntest('i need to write this test'); // invalid\ntest('i need to write this test', () => {}); // invalid\ntest.skip('i need to write this test', () => {}); // invalid","sourceCodeStart":1,"sourceCodeEnd":32,"githubUrl":"https://github.com/oxc-project/oxc/blob/e1e7af627c8843ab64044ed466b128fcc21a035b/crates/oxc_linter/src/rules/shared/jest_vitest/prefer_todo.rs#L1-L32","documentation":"Warning from the oxlint `jest/prefer-todo` rule (source: crates/oxc_linter/src/rules/shared/jest_vitest/prefer_todo.rs:14). It fires on `test()`/`it()` calls whose callback body is empty, and suggests `test.todo(title)`, which jest and vitest surface in the summary output and never execute, making unfinished work visible instead of silently green.","triggerScenarios":"`test('does something', () => {});` or `it('works', () => {})` - a test or it call (identified via `is_type_of_jest_fn_call` with `JestGeneralFnKind`) whose callback contains no statements.","commonSituations":"Scaffolding tests to fill in later and forgetting them; TDD leftovers where the implementation step was dropped; PRs that accidentally merge empty stubs because the suite still passes.","solutions":["Convert the empty test to a todo: `test.todo('does something')`.","Or implement the test body - any statement removes the warning.","Suppress deliberately-kept placeholders with `// oxlint-disable-next-line jest/prefer-todo`."],"exampleFix":"// before\ntest('handles retry logic', () => {});\n\n// after\ntest.todo('handles retry logic');","handlingStrategy":"validation","validationCode":"// rg -nU \"(test|it)\\([^)]*,\\s*\\(\\)\\s*=>\\s*\\{\\s*\\}\" tests/ -t ts -t js","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scaffold pending tests as test.todo() instead of empty callbacks","Grep for empty test bodies before merging a branch","Treat green-but-empty suites as review blockers"],"tags":["jest","vitest","oxlint","test-structure","todo"],"backgroundTag":"jest-empty-test-case","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"}