Skip to content

Commit

Permalink
add some testes
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Nov 16, 2022
1 parent c64269b commit 90ae183
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions tests/src/rules/no-duplicates.js
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,41 @@ context('TypeScript', function () {
},
],
}),
test({
code: "import {type x} from 'foo'; import type {y} from 'foo'",
...parserConfig,
output: `import {type x,y} from 'foo'; `,
errors: [
{
line: 1,
column: 22,
message: "'foo' imported multiple times.",
},
{
line: 1,
column: 50,
message: "'foo' imported multiple times.",
},
],
}),
test({
code: "import {type x} from './foo'; import {type y} from './foo'",
...parserConfig,
options: [{ 'prefer-inline': true }],
output: `import {type x,type y} from './foo'; `,
errors: [
{
line: 1,
column: 22,
message: "'./foo' imported multiple times.",
},
{
line: 1,
column: 52,
message: "'./foo' imported multiple times.",
},
],
}),
test({
code: "import {type x} from './foo'; import {type y} from './foo'",
...parserConfig,
Expand Down

0 comments on commit 90ae183

Please sign in to comment.