Skip to content

Commit 9fd3c42

Browse files
committed
[Tests] no-duplicates: add passing test
Closes #2840
1 parent 12f0300 commit 9fd3c42

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

tests/src/rules/no-duplicates.js

+62
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,68 @@ import {x,y} from './foo'
482482
errors: ["'../constants' imported multiple times.", "'../constants' imported multiple times."],
483483
...jsxConfig,
484484
}),
485+
486+
test({
487+
code: `
488+
import {A1,} from 'foo';
489+
import {B1,} from 'foo';
490+
import {C1,} from 'foo';
491+
492+
import {
493+
A2,
494+
} from 'bar';
495+
import {
496+
B2,
497+
} from 'bar';
498+
import {
499+
C2,
500+
} from 'bar';
501+
502+
`,
503+
output: `
504+
import {A1,B1,C1} from 'foo';
505+
${''}
506+
import {
507+
A2,
508+
${''}
509+
B2,
510+
C2} from 'bar';
511+
${''}
512+
`,
513+
errors: [
514+
{
515+
message: "'foo' imported multiple times.",
516+
line: 2,
517+
column: 27,
518+
},
519+
{
520+
message: "'foo' imported multiple times.",
521+
line: 3,
522+
column: 27,
523+
},
524+
{
525+
message: "'foo' imported multiple times.",
526+
line: 4,
527+
column: 27,
528+
},
529+
{
530+
message: "'bar' imported multiple times.",
531+
line: 8,
532+
column: 16,
533+
},
534+
{
535+
message: "'bar' imported multiple times.",
536+
line: 11,
537+
column: 16,
538+
},
539+
{
540+
message: "'bar' imported multiple times.",
541+
line: 14,
542+
column: 16,
543+
},
544+
],
545+
...jsxConfig,
546+
}),
485547
],
486548
});
487549

0 commit comments

Comments
 (0)