From d8f8f4c217c616bb42f9855750fb9c0f7a0cfa2b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Sun, 24 Feb 2019 17:14:11 -0500 Subject: [PATCH] That sweet feeling of even more coverage --- .../rules/boolean-literal-compare.test.ts | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/boolean-literal-compare.test.ts b/packages/eslint-plugin/tests/rules/boolean-literal-compare.test.ts index 3d68f84d2915..5a70b7b2d9ee 100644 --- a/packages/eslint-plugin/tests/rules/boolean-literal-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/boolean-literal-compare.test.ts @@ -15,16 +15,17 @@ const ruleTester = new RuleTester({ ruleTester.run('boolean-literal-compare', rule, { valid: [ - ` -3 > 4; -4 < 7; -`, - ` -3 == 4; -4 === 3; -4 === 7; -7 !== 4; -`, + '3 > 4;', + '4 < 7;', + '3 == 4;', + '4 === 3;', + '7 !== 4;', + '({} === {});', + '({} === 3);', + '(3 !== {});', + '({} > {});', + '({} > 3);', + '(3 > {});', ` declare const varAny: any; varAny === 'true'; @@ -67,7 +68,17 @@ let union: boolean | undefined; union === true; `, ` -let union: (boolean | boolean) | undefined; + let union: (boolean | boolean) | undefined; + +union === true; +`, + ` +let union: (boolean | {}) | undefined; + +union === true; +`, + ` +let union: (boolean | {}) | false; union === true; `,