Skip to content

Commit ede986c

Browse files
committed
refactor(no-standalone-expect): remove unneeded check
1 parent c0c7bef commit ede986c

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/rules/no-standalone-expect.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {
44
} from '@typescript-eslint/experimental-utils';
55
import {
66
DescribeAlias,
7-
TestCaseName,
87
createRule,
98
getNodeName,
109
isDescribeCall,
@@ -47,14 +46,6 @@ const getBlockType = (
4746
return null;
4847
};
4948

50-
const isEach = (node: TSESTree.CallExpression): boolean =>
51-
node.callee.type === AST_NODE_TYPES.CallExpression &&
52-
node.callee.callee.type === AST_NODE_TYPES.MemberExpression &&
53-
node.callee.callee.property.type === AST_NODE_TYPES.Identifier &&
54-
node.callee.callee.property.name === 'each' &&
55-
node.callee.callee.object.type === AST_NODE_TYPES.Identifier &&
56-
TestCaseName.hasOwnProperty(node.callee.callee.object.name);
57-
5849
type BlockType = 'test' | 'function' | 'describe' | 'arrow' | 'template';
5950

6051
export default createRule<
@@ -121,9 +112,8 @@ export default createRule<
121112

122113
if (
123114
(top === 'test' &&
124-
(isEach(node) ||
125-
(isTestBlock(node) &&
126-
node.callee.type !== AST_NODE_TYPES.MemberExpression))) ||
115+
isTestBlock(node) &&
116+
node.callee.type !== AST_NODE_TYPES.MemberExpression) ||
127117
(top === 'template' &&
128118
node.callee.type === AST_NODE_TYPES.TaggedTemplateExpression)
129119
) {

0 commit comments

Comments
 (0)