From c9169022c7e4b9c7bd5f09060152f7136ee18521 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 7 Mar 2021 08:32:19 +1300 Subject: [PATCH] fix(no-disabled-tests): adjust selector to match only test functions (#777) --- 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 f649cd225..4d8118bd3 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 5530167d9..b6b5490f6 100644 --- a/src/rules/no-disabled-tests.ts +++ b/src/rules/no-disabled-tests.ts @@ -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--; }, };