Skip to content

Commit

Permalink
Added tests for a few more odd types to get more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Goldberg committed Feb 24, 2019
1 parent 0d268cc commit 2b3d6ec
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions packages/eslint-plugin/tests/rules/boolean-literal-compare.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ const ruleTester = new RuleTester({
ruleTester.run('boolean-literal-compare', rule, {
valid: [
`
3 > 4;
4 < 7;
`,
`
3 == 4;
4 === 3;
4 === 7;
7 !== 4;
`,
`
declare const varAny: any;
varAny === 'true';
varAny === 'true';
Expand All @@ -32,6 +42,12 @@ varObject == varString;
`
let union: {} | boolean;
union === true;
union === false;
`,
`
let union: ({} | {}) | boolean;
union === true;
union === false;
`,
Expand All @@ -48,6 +64,11 @@ union === true;
`
let union: boolean | undefined;
union === true;
`,
`
let union: (boolean | boolean) | undefined;
union === true;
`,
],
Expand Down

0 comments on commit 2b3d6ec

Please sign in to comment.