Skip to content

Commit

Permalink
Add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
ertrzyiks committed Apr 13, 2021
1 parent e871a9a commit ab5c36e
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,74 @@ ruleTester.run('no-duplicates', rule, {
`,
errors: ['\'./foo\' imported multiple times.', '\'./foo\' imported multiple times.'],
}),


// #2027 long import list generate empty lines
test({
code: `
import { One } from './one'
import { Two } from './two'
import { Three } from './three'
import { Four } from './four'
import { Five } from './five'
import { Six } from './six'
import { Seven } from './seven'
import { Eight } from './eight'
import { Nine } from './nine'
import { Ten } from './ten'
import { Eleven } from './eleven'
import { OneDoc } from './one'
import { TwoDoc } from './two'
import { ThreeDoc } from './three'
import { FourDoc } from './four'
import { FiveDoc } from './five'
import { SixDoc } from './six'
import { SevenDoc } from './seven'
import { EightDoc } from './eight'
import { NineDoc } from './nine'
import { TenDoc } from './ten'
import { ElevenDoc } from './eleven'
export const value = {}
`,
output: `
import { One, OneDoc } from './one'
import { Two, TwoDoc } from './two'
import { Three, ThreeDoc } from './three'
import { Four, FourDoc } from './four'
import { Five, FiveDoc } from './five'
import { Six, SixDoc } from './six'
import { Seven, SevenDoc } from './seven'
import { Eight, EightDoc } from './eight'
import { Nine, NineDoc } from './nine'
import { Ten, TenDoc } from './ten'
import { Eleven, ElevenDoc } from './eleven'
export const value = {}
`,
errors: [
'\'./one\' imported multiple times.',
'\'./two\' imported multiple times.',
'\'./three\' imported multiple times.',
'\'./four\' imported multiple times.',
'\'./five\' imported multiple times.',
'\'./six\' imported multiple times.',
'\'./seven\' imported multiple times.',
'\'./eight\' imported multiple times.',
'\'./nine\' imported multiple times.',
'\'./ten\' imported multiple times.',
'\'./eleven\' imported multiple times.',
'\'./one\' imported multiple times.',
'\'./two\' imported multiple times.',
'\'./three\' imported multiple times.',
'\'./four\' imported multiple times.',
'\'./five\' imported multiple times.',
'\'./six\' imported multiple times.',
'\'./seven\' imported multiple times.',
'\'./eight\' imported multiple times.',
'\'./nine\' imported multiple times.',
'\'./ten\' imported multiple times.',
'\'./eleven\' imported multiple times.',
],
}),
],
});

Expand Down

0 comments on commit ab5c36e

Please sign in to comment.