Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit 5af5c98

Browse files
Add a test case with two duplicates
1 parent 0a10153 commit 5af5c98

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

tests/rules/no-identical-conditions.test.ts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,5 +160,43 @@ ruleTester.run('no-identical-conditions', rule, {
160160
},
161161
],
162162
},
163+
{
164+
code: `
165+
switch (a) {
166+
case 1:
167+
f();
168+
break;
169+
case 2:
170+
g();
171+
break;
172+
case 1:
173+
h();
174+
break;
175+
case 1:
176+
i();
177+
break;
178+
}
179+
`,
180+
errors: [
181+
{
182+
messageId: 'duplicatedCase',
183+
data: {
184+
line: 3,
185+
},
186+
line: 9,
187+
column: 16,
188+
endColumn: 17,
189+
},
190+
{
191+
messageId: 'duplicatedCase',
192+
data: {
193+
line: 3,
194+
},
195+
line: 12,
196+
column: 16,
197+
endColumn: 17,
198+
},
199+
],
200+
},
163201
],
164202
});

0 commit comments

Comments
 (0)