Skip to content

Commit 885ce17

Browse files
committedMay 27, 2018
fix: handle callexpressions with anonymous calles
1 parent 7707e14 commit 885ce17

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed
 

Diff for: ‎rules/__tests__/no-jasmine-globals.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ruleTester.run('no-jasmine-globals', rule, {
1414
'it("foo", function () {})',
1515
'test("foo", function () {})',
1616
'foo()',
17+
`require('foo')('bar')`,
1718
],
1819
invalid: [
1920
{

Diff for: ‎rules/no-jasmine-globals.js

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ module.exports = {
1515
CallExpression(node) {
1616
const calleeName = getNodeName(node.callee);
1717

18+
if (!calleeName) {
19+
return;
20+
}
21+
1822
if (calleeName === 'spyOn' || calleeName === 'spyOnProperty') {
1923
context.report({
2024
node,

0 commit comments

Comments
 (0)
Please sign in to comment.