Skip to content

Commit

Permalink
fix(no-disabled-tests): adjust selector to match only test functions (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Rath committed Mar 6, 2021
1 parent 27a7245 commit c916902
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/rules/__tests__/no-disabled-tests.test.ts
Expand Up @@ -29,6 +29,8 @@ ruleTester.run('no-disabled-tests', rule, {
'(a || b).f()',
'itHappensToStartWithIt()',
'testSomething()',
'xitSomethingElse()',
'xitiViewMap()',
dedent`
import { pending } from "actions"
Expand Down
4 changes: 2 additions & 2 deletions src/rules/no-disabled-tests.ts
Expand Up @@ -77,13 +77,13 @@ export default createRule({
'CallExpression[callee.name="xdescribe"]'(node) {
context.report({ messageId: 'disabledSuite', node });
},
'CallExpression[callee.name=/^xit|xtest$/]'(node) {
'CallExpression[callee.name=/^(xit|xtest)$/]'(node) {
context.report({ messageId: 'disabledTest', node });
},
'CallExpression[callee.name="describe"]:exit'() {
suiteDepth--;
},
'CallExpression[callee.name=/^it|test$/]:exit'() {
'CallExpression[callee.name=/^(it|test)$/]:exit'() {
testDepth--;
},
};
Expand Down

0 comments on commit c916902

Please sign in to comment.