@@ -120,13 +120,8 @@ const isParentThenOrPromiseReturned = (
120120 node . type === AST_NODE_TYPES . ReturnStatement ||
121121 isPromiseReturnedLater ( node , testFunctionBody ) ;
122122
123- type PromiseCallbacks = [
124- TSESTree . Expression | undefined ,
125- TSESTree . Expression | undefined ,
126- ] ;
127-
128123const verifyExpectWithReturn = (
129- promiseCallbacks : PromiseCallbacks ,
124+ promiseCallbacks : Array < TSESTree . CallExpressionArgument | undefined > ,
130125 node : CalledKnownMemberExpression < 'then' | 'catch' > ,
131126 context : RuleContext ,
132127 testFunctionBody : TSESTree . Statement [ ] ,
@@ -187,14 +182,13 @@ export default createRule<unknown[], MessageIds>({
187182 }
188183
189184 const testFunctionBody = body . body ;
190- const [ fulfillmentCallback , rejectionCallback ] = node . arguments ;
191185
192186 // then block can have two args, fulfillment & rejection
193187 // then block can have one args, fulfillment
194188 // catch block can have one args, rejection
195189 // ref: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
196190 verifyExpectWithReturn (
197- [ fulfillmentCallback , rejectionCallback ] ,
191+ node . arguments . slice ( 0 , 2 ) ,
198192 node . callee ,
199193 context ,
200194 testFunctionBody ,
0 commit comments