Skip to content

Commit

Permalink
Chore: add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Apr 2, 2019
1 parent e16afa9 commit e3b4bbb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/lib/rules/no-confusing-arrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ const ruleTester = new RuleTester({ parserOptions: { ecmaVersion: 6 } });
ruleTester.run("no-confusing-arrow", rule, {
valid: [
"a => { return 1 ? 2 : 3; }",
{ code: "a => { return 1 ? 2 : 3; }", options: [{ allowParens: false }] },

"var x = a => { return 1 ? 2 : 3; }",
{ code: "var x = a => { return 1 ? 2 : 3; }", options: [{ allowParens: false }] },

"var x = (a) => { return 1 ? 2 : 3; }",
{ code: "var x = a => (1 ? 2 : 3)", options: [{ allowParens: true }] },
"var x = a => (1 ? 2 : 3)"
{ code: "var x = (a) => { return 1 ? 2 : 3; }", options: [{ allowParens: false }] },

"var x = a => (1 ? 2 : 3)",
{ code: "var x = a => (1 ? 2 : 3)", options: [{ allowParens: true }] }
],
invalid: [
{
Expand Down

0 comments on commit e3b4bbb

Please sign in to comment.