Skip to content

Commit 6ab25ea

Browse files
committed
[Tests] skip a TS test in eslint < 4
1 parent 405900e commit 6ab25ea

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

tests/src/rules/export.js

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -126,21 +126,25 @@ context('Typescript', function () {
126126
},
127127
}
128128

129+
const isLT4 = process.env.ESLINT_VERSION === '3' || process.env.ESLINT_VERSION === '2';
130+
const valid = [
131+
test(Object.assign({
132+
code: `
133+
export const Foo = 1;
134+
export interface Foo {}
135+
`,
136+
}, parserConfig)),
137+
]
138+
if (!isLT4) {
139+
valid.unshift(test(Object.assign({
140+
code: `
141+
export const Foo = 1;
142+
export type Foo = number;
143+
`,
144+
}, parserConfig)))
145+
}
129146
ruleTester.run('export', rule, {
130-
valid: [
131-
test(Object.assign({
132-
code: `
133-
export const Foo = 1;
134-
export type Foo = number;
135-
`,
136-
}, parserConfig),
137-
test(Object.assign({
138-
code: `
139-
export const Foo = 1;
140-
export interface Foo {}
141-
`,
142-
}, parserConfig))),
143-
],
147+
valid: valid,
144148
invalid: [],
145149
})
146150
})

0 commit comments

Comments
 (0)