Skip to content

Commit

Permalink
feat(no-disabled-tests): make error ranges smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Oct 22, 2023
1 parent f1e1549 commit 1ef11ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/rules/no-disabled-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ export default createEslintRule<Options, MESSAGE_ID>({
}
}

if (vitestFnCall.name.startsWith('x') || vitestFnCall.members.some(s => getAccessorValue(s) === 'skip')) {
const skipMember = vitestFnCall.members.find(s => getAccessorValue(s) === 'skip')
if (vitestFnCall.name.startsWith('x') || skipMember !== undefined) {
context.report({
messageId: vitestFnCall.type === 'describe' ? 'disabledSuite' : 'disabledTest',
node
node: skipMember ?? vitestFnCall.head.node
})
}
},
Expand Down

0 comments on commit 1ef11ca

Please sign in to comment.