chore: fix no-flaky-assertions not working withing .toPass callbacks
This commit is contained in:
@@ -82,6 +82,19 @@ module.exports = {
|
||||
return false
|
||||
}
|
||||
|
||||
function hasExpectPollOrToPassInParentChain(node) {
|
||||
let ancestor = node
|
||||
|
||||
while (ancestor) {
|
||||
if (isExpectPollOrToPass(ancestor)) {
|
||||
return true
|
||||
}
|
||||
ancestor = ancestor.parent
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
return {
|
||||
CallExpression(node) {
|
||||
// node.callee is MemberExpressiom
|
||||
@@ -90,6 +103,10 @@ module.exports = {
|
||||
return
|
||||
}
|
||||
|
||||
if (hasExpectPollOrToPassInParentChain(node)) {
|
||||
return
|
||||
}
|
||||
|
||||
context.report({
|
||||
node: node.callee.property,
|
||||
message:
|
||||
|
||||
Reference in New Issue
Block a user