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.

ruleTester.describe(rule, {
valid: ["a", "a"],
});
ruleTester.describe(rule, {
invalid: [
{
code: `
a;
`,
snapshot: `
a;
~
Lint report for a.
`,
},
{
code: `
a;
`,
snapshot: `
a;
~
Lint report for a.
`,
},
],
});

This rule is not configurable.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.