Skip to content

Commit

Permalink
Chore: trailing comma test case for radix
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Apr 23, 2021
1 parent 45434b4 commit 0154de3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/lib/rules/radix.js
Expand Up @@ -80,6 +80,15 @@ ruleTester.run("radix", rule, {
suggestions: [{ messageId: "addRadixParameter10", output: "parseInt(\"10\", 10);" }]
}]
},
{
code: "parseInt(\"10\",);", // Function parameter with trailing comma
parserOptions: { ecmaVersion: 2017 },
errors: [{
messageId: "missingRadix",
type: "CallExpression",
suggestions: [{ messageId: "addRadixParameter10", output: "parseInt(\"10\", 10,);" }]
}]
},
{
code: "parseInt(\"10\", null);",
errors: [{
Expand Down

0 comments on commit 0154de3

Please sign in to comment.