Skip to content

Commit

Permalink
Chore: add test for no-constant-condition (#12836)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored and kaicataldo committed Jan 28, 2020
1 parent 533c114 commit f5b9656
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/lib/rules/no-constant-condition.js
Expand Up @@ -261,6 +261,10 @@ ruleTester.run("no-constant-condition", rule, {
code: "if([a] - '') {}",
errors: [{ messageId: "unexpected", type: "BinaryExpression" }]
},
{
code: "if(+[a]) {}",
errors: [{ messageId: "unexpected", type: "UnaryExpression" }]
},
{
code: "if(+1) {}",
errors: [{ messageId: "unexpected", type: "UnaryExpression" }]
Expand Down

0 comments on commit f5b9656

Please sign in to comment.