diff --git a/lib/rules/no-inner-compare.js b/lib/rules/no-inner-compare.js index 79dc00f..28d7b78 100755 --- a/lib/rules/no-inner-compare.js +++ b/lib/rules/no-inner-compare.js @@ -17,7 +17,7 @@ module.exports = function(context) { return { ExpressionStatement: function(node) { var expression = node.expression; - if (expression.type !== 'MemberExpression') + if (expression.type !== 'MemberExpression' && expression.type !== 'CallExpression') return; var expect = findExpectCall(expression); diff --git a/tests/lib/rules/no-inner-compare.js b/tests/lib/rules/no-inner-compare.js index 3a38c03..339d4c3 100755 --- a/tests/lib/rules/no-inner-compare.js +++ b/tests/lib/rules/no-inner-compare.js @@ -11,6 +11,8 @@ ruleTester.run('no-inner-compare', rule, { code: 'expect(a && b).to.be.ok;' }, { code: 'expect(a || b).to.be.ok;' + }, { + code: 'expect(a).to.equal(5);' }], invalid: [{ @@ -33,5 +35,10 @@ ruleTester.run('no-inner-compare', rule, { errors: [{ message: 'operator ">=" used in expect(), use "to.be.at.least()" instead' }] + }, { + code: 'expect(a >= b).to.equal(true);', + errors: [{ + message: 'operator ">=" used in expect(), use "to.be.at.least()" instead' + }] }] });