@@ -8,7 +8,7 @@ const reportMsg =
88const isThenOrCatch = node => {
99 return (
1010 node . property &&
11- ( node . property . name == 'then' || node . property . name == 'catch' )
11+ ( node . property . name === 'then' || node . property . name = == 'catch' )
1212 ) ;
1313} ;
1414
@@ -27,7 +27,7 @@ const isExpectCallPresentInFunction = body => {
2727const isExpectCall = expression => {
2828 return (
2929 expression &&
30- expression . type == 'CallExpression' &&
30+ expression . type === 'CallExpression' &&
3131 expression . callee . type === 'MemberExpression' &&
3232 expression . callee . object . type === 'CallExpression' &&
3333 expression . callee . object . callee . name === 'expect'
@@ -86,8 +86,8 @@ const getTestFunction = node => {
8686
8787const isParentThenOrPromiseReturned = ( node , testFunctionBody ) => {
8888 return (
89- testFunctionBody . type == 'CallExpression' ||
90- node . parent . parent . type == 'ReturnStatement' ||
89+ testFunctionBody . type === 'CallExpression' ||
90+ node . parent . parent . type === 'ReturnStatement' ||
9191 isPromiseReturnedLater ( node , testFunctionBody ) ||
9292 isThenOrCatch ( node . parent . parent )
9393 ) ;
@@ -113,7 +113,7 @@ const verifyExpectWithReturn = (
113113} ;
114114
115115const isAwaitExpression = node => {
116- return node . parent . parent && node . parent . parent . type == 'AwaitExpression' ;
116+ return node . parent . parent && node . parent . parent . type === 'AwaitExpression' ;
117117} ;
118118
119119const isHavingAsyncCallBackParam = testFunction => {
@@ -135,9 +135,9 @@ module.exports = {
135135 return {
136136 MemberExpression ( node ) {
137137 if (
138- node . type == 'MemberExpression' &&
138+ node . type === 'MemberExpression' &&
139139 isThenOrCatch ( node ) &&
140- node . parent . type == 'CallExpression' &&
140+ node . parent . type === 'CallExpression' &&
141141 ! isAwaitExpression ( node )
142142 ) {
143143 const testFunction = getTestFunction ( node ) ;
0 commit comments