Skip to content

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.

const ruleTester: any
ruleTester
.
any
describe
(
const rule: any
rule
, {
valid: string[]
valid
: ["a", "a"],
});
const ruleTester: any
ruleTester
.
any
describe
(
const rule: any
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.
`,
},
],
});

This rule is not configurable.

Made with ❤️‍🔥 around the world by the Flint team and contributors.