{"record":{"id":"83cf68db70a7f98f","repo":"avajs/ava","slug":"todo-tests-are-not-allowed-to-have-an-implementa","errorCode":null,"errorMessage":"`todo` tests are not allowed to have an implementation. Use `test.skip()` for tests with an implementation.","messagePattern":"`todo` tests are not allowed to have an implementation\\. Use `test\\.skip\\(\\)` for tests with an implementation\\.","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"lib/runner.js","lineNumber":108,"sourceCode":"\t\t\t}\n\n\t\t\tif (!scheduledStart) {\n\t\t\t\tscheduledStart = true;\n\t\t\t\tprocess.nextTick(() => {\n\t\t\t\t\thasStarted = true;\n\t\t\t\t\tthis.start();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tmetadata.taskIndex = this.nextTaskIndex++;\n\n\t\t\tconst {args, implementation, title} = parseTestArgs(testArgs);\n\n\t\t\tmetadata.selected &&= this.checkSelectedByLineNumbers?.() ?? true;\n\n\t\t\tif (metadata.todo) {\n\t\t\t\tif (implementation) {\n\t\t\t\t\tthrow new TypeError('`todo` tests are not allowed to have an implementation. Use `test.skip()` for tests with an implementation.');\n\t\t\t\t}\n\n\t\t\t\tif (!title.raw) { // Either undefined or a string.\n\t\t\t\t\tthrow new TypeError('`todo` tests require a title');\n\t\t\t\t}\n\n\t\t\t\tif (!this.registerUniqueTitle(title.value)) {\n\t\t\t\t\tthrow new Error(`Duplicate test title: ${title.value}`);\n\t\t\t\t}\n\n\t\t\t\t// --match selects TODO tests.\n\t\t\t\tmetadata.selected &&= isTitleMatch(title.value, this.matchPatterns);\n\n\t\t\t\tthis.tasks.todo.push({title: title.value, metadata});\n\t\t\t\tthis.emit('stateChange', {\n\t\t\t\t\ttype: 'declared-test',\n\t\t\t\t\ttitle: title.value,\n\t\t\t\t\tknownFailing: false,","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/avajs/ava/blob/bbfd946322fdeca2b547a691d947fb4e18c0c67f/lib/runner.js#L90-L126","documentation":"Runner guard for todo declarations: test.todo('title', implementation) was called with an implementation function, but todo tests are placeholders without bodies. The erroneous input is the second (implementation) argument passed alongside a .todo() declaration.","triggerScenarios":"Thrown at lib/runner.js:108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Drop the implementation: use test.todo('title') only","Use test.skip('title', impl) when the test has a body you want recorded as skipped","Keep planned-work notes in todo entries without function bodies"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bbfd946322fdeca2b547a691d947fb4e18c0c67f","analyzedAt":"2026-09-02T01:24:43.834Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T06:17:21.866Z"}