Skip to content

Commit

Permalink
fix: Fix no-assigning-return-values no callee exception (fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbreiding committed Nov 8, 2018
2 parents 13ff374 + a007ecc commit 02391a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/rules/no-assigning-return-values.js
Expand Up @@ -40,6 +40,9 @@ function isCypressCommandDeclaration(declarator) {

while (object.callee) {
object = object.callee.object;
if (!object) {
return;
}
}

return object.name === 'cy';
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/no-assigning-return-values.js
Expand Up @@ -14,6 +14,7 @@ ruleTester.run('no-assigning-return-values', rule, {
{ code: 'let foo = true;', parserOptions },
{ code: 'const foo = true;', parserOptions },
{ code: 'const foo = bar();', parserOptions },
{ code: 'const foo = bar().baz();', parserOptions },
{ code: 'cy.get("foo");', parserOptions },
{ code: 'cy.contains("foo").click();', parserOptions }
],
Expand Down

0 comments on commit 02391a0

Please sign in to comment.