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
randing89 committed Nov 8, 2018
1 parent 13ff374 commit a007ecc
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 a007ecc

Please sign in to comment.