Skip to content

Commit

Permalink
fix: handle callexpressions with anonymous calles
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 27, 2018
1 parent 7707e14 commit 885ce17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions rules/__tests__/no-jasmine-globals.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ruleTester.run('no-jasmine-globals', rule, {
'it("foo", function () {})',
'test("foo", function () {})',
'foo()',
`require('foo')('bar')`,
],
invalid: [
{
Expand Down
4 changes: 4 additions & 0 deletions rules/no-jasmine-globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ module.exports = {
CallExpression(node) {
const calleeName = getNodeName(node.callee);

if (!calleeName) {
return;
}

if (calleeName === 'spyOn' || calleeName === 'spyOnProperty') {
context.report({
node,
Expand Down

0 comments on commit 885ce17

Please # to comment.