Skip to content

Commit

Permalink
[Tests] skip a TS test in eslint < 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Apr 12, 2019
1 parent 405900e commit 6ab25ea
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions tests/src/rules/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,25 @@ context('Typescript', function () {
},
}

const isLT4 = process.env.ESLINT_VERSION === '3' || process.env.ESLINT_VERSION === '2';
const valid = [
test(Object.assign({
code: `
export const Foo = 1;
export interface Foo {}
`,
}, parserConfig)),
]
if (!isLT4) {
valid.unshift(test(Object.assign({
code: `
export const Foo = 1;
export type Foo = number;
`,
}, parserConfig)))
}
ruleTester.run('export', rule, {
valid: [
test(Object.assign({
code: `
export const Foo = 1;
export type Foo = number;
`,
}, parserConfig),
test(Object.assign({
code: `
export const Foo = 1;
export interface Foo {}
`,
}, parserConfig))),
],
valid: valid,
invalid: [],
})
})
Expand Down

0 comments on commit 6ab25ea

Please sign in to comment.