@@ -96,6 +96,19 @@ export enum HookName {
9696 'afterEach' = 'afterEach' ,
9797}
9898
99+ export enum DescribeProperty {
100+ 'each' = 'each' ,
101+ 'only' = 'only' ,
102+ 'skip' = 'skip' ,
103+ }
104+
105+ export enum TestCaseProperty {
106+ 'each' = 'each' ,
107+ 'only' = 'only' ,
108+ 'skip' = 'skip' ,
109+ 'todo' = 'todo' ,
110+ }
111+
99112export type JestFunctionName = DescribeAlias | TestCaseName | HookName ;
100113
101114export interface JestFunctionIdentifier < FunctionName extends JestFunctionName >
@@ -178,7 +191,9 @@ export const isTestCase = (
178191 TestCaseName . hasOwnProperty ( node . callee . name ) ) ||
179192 ( node . callee . type === AST_NODE_TYPES . MemberExpression &&
180193 node . callee . object . type === AST_NODE_TYPES . Identifier &&
181- TestCaseName . hasOwnProperty ( node . callee . object . name ) )
194+ TestCaseName . hasOwnProperty ( node . callee . object . name ) &&
195+ node . callee . property . type === AST_NODE_TYPES . Identifier &&
196+ TestCaseProperty . hasOwnProperty ( node . callee . property . name ) )
182197 ) ;
183198} ;
184199
@@ -190,7 +205,9 @@ export const isDescribe = (
190205 DescribeAlias . hasOwnProperty ( node . callee . name ) ) ||
191206 ( node . callee . type === AST_NODE_TYPES . MemberExpression &&
192207 node . callee . object . type === AST_NODE_TYPES . Identifier &&
193- DescribeAlias . hasOwnProperty ( node . callee . object . name ) )
208+ DescribeAlias . hasOwnProperty ( node . callee . object . name ) &&
209+ node . callee . property . type === AST_NODE_TYPES . Identifier &&
210+ DescribeProperty . hasOwnProperty ( node . callee . property . name ) )
194211 ) ;
195212} ;
196213
0 commit comments