File tree 1 file changed +7
-3
lines changed
packages/babel-plugin-jest-hoist/src
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,10 @@ import {
14
14
CallExpression ,
15
15
Expression ,
16
16
Identifier ,
17
+ MemberExpression ,
17
18
Node ,
18
19
Program ,
20
+ Super ,
19
21
VariableDeclaration ,
20
22
VariableDeclarator ,
21
23
callExpression ,
@@ -197,7 +199,9 @@ function GETTER_NAME() {
197
199
}
198
200
` ;
199
201
200
- const isJestObject = ( expression : NodePath < Expression > ) : boolean => {
202
+ const isJestObject = (
203
+ expression : NodePath < Expression | Super > ,
204
+ ) : expression is NodePath < Identifier | MemberExpression > => {
201
205
// global
202
206
if (
203
207
expression . isIdentifier ( ) &&
@@ -231,8 +235,8 @@ const isJestObject = (expression: NodePath<Expression>): boolean => {
231
235
return false ;
232
236
} ;
233
237
234
- const extractJestObjExprIfHoistable = < T extends Node > (
235
- expr : NodePath < T > ,
238
+ const extractJestObjExprIfHoistable = (
239
+ expr : NodePath ,
236
240
) : NodePath < Expression > | null => {
237
241
if ( ! expr . isCallExpression ( ) ) {
238
242
return null ;
You can’t perform that action at this time.
0 commit comments