Skip to content

Commit

Permalink
fix(no-disabled-tests): don't report on it.todo & test.todo (#1137)
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed May 30, 2022
1 parent 5162b0f commit b651443
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/rules/__tests__/no-disabled-tests.test.ts
Expand Up @@ -23,6 +23,7 @@ ruleTester.run('no-disabled-tests', rule, {
'test.only("foo", function () {})',
'test.concurrent("foo", function () {})',
'describe[`${"skip"}`]("foo", function () {})',
'it.todo("fill this later")',
'var appliedSkip = describe.skip; appliedSkip.apply(describe)',
'var calledSkip = it.skip; calledSkip.call(it)',
'({ f: function () {} }).f()',
Expand Down
5 changes: 4 additions & 1 deletion src/rules/no-disabled-tests.ts
Expand Up @@ -44,7 +44,10 @@ export default createRule({
if (jestFnCall.type === 'test') {
testDepth++;

if (node.arguments.length < 2) {
if (
node.arguments.length < 2 &&
jestFnCall.members.every(s => getAccessorValue(s) !== 'todo')
) {
context.report({ messageId: 'missingFunction', node });
}
}
Expand Down

0 comments on commit b651443

Please sign in to comment.