testCaseDuplicates
Reports test cases that are identical to previous test cases.
✅ This rule is included in the flint logical presets.
When writing tests for lint rules, it’s possible to accidentally create deeply identical test cases. Doing so provides no added benefit for testing and is unnecessary.
Examples
Section titled “Examples”const ruleTester: RuleTester
ruleTester.any
describe(const rule: AnyRule
rule, { valid: string[]
valid: ["a", "a"],});const ruleTester: RuleTester
ruleTester.any
describe(const rule: AnyRule
rule, { invalid: { code: string; snapshot: string;}[]
invalid: [ { code: string
code: ` a; `, snapshot: string
snapshot: ` a; ~ Lint report for a. `, }, { code: string
code: ` a; `, snapshot: string
snapshot: ` a; ~ Lint report for a. `, }, ],});const ruleTester: RuleTester
ruleTester.any
describe(const rule: AnyRule
rule, { valid: string[]
valid: ["a", "b"],});const ruleTester: RuleTester
ruleTester.any
describe(const rule: AnyRule
rule, { invalid: { code: string; snapshot: string;}[]
invalid: [ { code: string
code: ` a; `, snapshot: string
snapshot: ` a; ~ Lint report for a. `, }, { code: string
code: ` b; `, snapshot: string
snapshot: ` b; ~ Lint report for b. `, }, ],});Options
Section titled “Options”This rule is not configurable.
Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 around the world by
the Flint team and contributors.