Skip to content

Commit

Permalink
Chore: update prefer-const test case
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jan 25, 2021
1 parent ae87625 commit b4f7f00
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/lib/rules/prefer-const.js
Expand Up @@ -500,9 +500,11 @@ ruleTester.run("prefer-const", rule, {
{ message: "'b' is never reassigned. Use 'const' instead.", type: "Identifier" }
]
},

// The inner `let` will be auto-fixed in the second pass
{
code: "let someFunc = () => { let a = 1, b = 2; foo(a, b) }",
output: "const someFunc = () => { const a = 1, b = 2; foo(a, b) }",
output: "const someFunc = () => { let a = 1, b = 2; foo(a, b) }",
errors: [
{ message: "'someFunc' is never reassigned. Use 'const' instead.", type: "Identifier" },
{ message: "'a' is never reassigned. Use 'const' instead.", type: "Identifier" },
Expand Down

0 comments on commit b4f7f00

Please sign in to comment.