From 64508325e3c1a6e8b0df5ff8eea8f34f5c92dc1b Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 7 Mar 2021 07:59:56 +1300 Subject: [PATCH] fix(no-disabled-tests): adjust selector to match only test functions --- src/rules/__tests__/no-disabled-tests.test.ts | 2 ++ src/rules/no-disabled-tests.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rules/__tests__/no-disabled-tests.test.ts b/src/rules/__tests__/no-disabled-tests.test.ts index 7141ca920..d45024e33 100644 --- a/src/rules/__tests__/no-disabled-tests.test.ts +++ b/src/rules/__tests__/no-disabled-tests.test.ts @@ -29,6 +29,8 @@ ruleTester.run('no-disabled-tests', rule, { '(a || b).f()', 'itHappensToStartWithIt()', 'testSomething()', + 'xitSomethingElse()', + 'xitiViewMap()', dedent` import { pending } from "actions" diff --git a/src/rules/no-disabled-tests.ts b/src/rules/no-disabled-tests.ts index 53f6233e1..ab40ed780 100644 --- a/src/rules/no-disabled-tests.ts +++ b/src/rules/no-disabled-tests.ts @@ -68,13 +68,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--; }, };